projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9f38e39
)
Remove redundant spaces.
author
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 9 Sep 2002 22:33:31 +0000
(22:33 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 9 Sep 2002 22:33:31 +0000
(22:33 +0000)
35 files changed:
lib/avl_tree.c
patch
|
blob
|
history
lib/avl_tree.h
patch
|
blob
|
history
lib/list.c
patch
|
blob
|
history
lib/list.h
patch
|
blob
|
history
src/conf.c
patch
|
blob
|
history
src/connection.c
patch
|
blob
|
history
src/cygwin/device.c
patch
|
blob
|
history
src/darwin/device.c
patch
|
blob
|
history
src/edge.c
patch
|
blob
|
history
src/event.c
patch
|
blob
|
history
src/event.h
patch
|
blob
|
history
src/freebsd/device.c
patch
|
blob
|
history
src/linux/device.c
patch
|
blob
|
history
src/meta.c
patch
|
blob
|
history
src/net.c
patch
|
blob
|
history
src/net_packet.c
patch
|
blob
|
history
src/net_setup.c
patch
|
blob
|
history
src/net_socket.c
patch
|
blob
|
history
src/netbsd/device.c
patch
|
blob
|
history
src/netutl.c
patch
|
blob
|
history
src/node.c
patch
|
blob
|
history
src/openbsd/device.c
patch
|
blob
|
history
src/process.c
patch
|
blob
|
history
src/protocol.c
patch
|
blob
|
history
src/protocol.h
patch
|
blob
|
history
src/protocol_auth.c
patch
|
blob
|
history
src/protocol_edge.c
patch
|
blob
|
history
src/protocol_key.c
patch
|
blob
|
history
src/protocol_misc.c
patch
|
blob
|
history
src/protocol_node.c
patch
|
blob
|
history
src/protocol_subnet.c
patch
|
blob
|
history
src/raw_socket/device.c
patch
|
blob
|
history
src/route.c
patch
|
blob
|
history
src/solaris/device.c
patch
|
blob
|
history
src/subnet.c
patch
|
blob
|
history
diff --git
a/lib/avl_tree.c
b/lib/avl_tree.c
index
009c680
..
575b2f1
100644
(file)
--- a/
lib/avl_tree.c
+++ b/
lib/avl_tree.c
@@
-29,7
+29,7
@@
library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
- $Id: avl_tree.c,v 1.1.2.1
0 2002/09/09 21:49:16
guus Exp $
+ $Id: avl_tree.c,v 1.1.2.1
1 2002/09/09 22:32:24
guus Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-89,7
+89,7
@@
int lg(unsigned int u)
/* Internal helper functions */
/* Internal helper functions */
-int avl_check_balance(avl_node_t *
node)
+int avl_check_balance(avl_node_t *node)
{
#ifdef AVL_DEPTH
int d;
{
#ifdef AVL_DEPTH
int d;
@@
-117,7
+117,7
@@
int avl_check_balance(avl_node_t * node)
#endif
}
#endif
}
-void avl_rebalance(avl_tree_t *
tree, avl_node_t *
node)
+void avl_rebalance(avl_tree_t *
tree, avl_node_t *
node)
{
avl_node_t *child;
avl_node_t *gchild;
{
avl_node_t *child;
avl_node_t *gchild;
@@
-272,7
+272,7
@@
avl_tree_t *avl_alloc_tree(avl_compare_t compare, avl_action_t delete)
return tree;
}
return tree;
}
-void avl_free_tree(avl_tree_t *
tree)
+void avl_free_tree(avl_tree_t *tree)
{
free(tree);
}
{
free(tree);
}
@@
-282,7
+282,7
@@
avl_node_t *avl_alloc_node(void)
return (avl_node_t *)xmalloc_and_zero(sizeof(avl_node_t));
}
return (avl_node_t *)xmalloc_and_zero(sizeof(avl_node_t));
}
-void avl_free_node(avl_tree_t *
tree, avl_node_t *
node)
+void avl_free_node(avl_tree_t *
tree, avl_node_t *
node)
{
if(node->data && tree->delete)
tree->delete(node->data);
{
if(node->data && tree->delete)
tree->delete(node->data);
@@
-292,7
+292,7
@@
void avl_free_node(avl_tree_t * tree, avl_node_t * node)
/* Searching */
/* Searching */
-void *avl_search(const avl_tree_t *
tree, const void *data)
+void *avl_search(const avl_tree_t *tree, const void *data)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-301,7
+301,7
@@
void *avl_search(const avl_tree_t * tree, const void *data)
return node ? node->data : NULL;
}
return node ? node->data : NULL;
}
-void *avl_search_closest(const avl_tree_t *
tree, const void *data, int *result)
+void *avl_search_closest(const avl_tree_t *tree, const void *data, int *result)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-310,7
+310,7
@@
void *avl_search_closest(const avl_tree_t * tree, const void *data, int *result)
return node ? node->data : NULL;
}
return node ? node->data : NULL;
}
-void *avl_search_closest_smaller(const avl_tree_t *
tree, const void *data)
+void *avl_search_closest_smaller(const avl_tree_t *tree, const void *data)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-319,7
+319,7
@@
void *avl_search_closest_smaller(const avl_tree_t * tree, const void *data)
return node ? node->data : NULL;
}
return node ? node->data : NULL;
}
-void *avl_search_closest_greater(const avl_tree_t *
tree, const void *data)
+void *avl_search_closest_greater(const avl_tree_t *tree, const void *data)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-328,7
+328,7
@@
void *avl_search_closest_greater(const avl_tree_t * tree, const void *data)
return node ? node->data : NULL;
}
return node ? node->data : NULL;
}
-avl_node_t *avl_search_node(const avl_tree_t *
tree, const void *data)
+avl_node_t *avl_search_node(const avl_tree_t *tree, const void *data)
{
avl_node_t *node;
int result;
{
avl_node_t *node;
int result;
@@
-338,7
+338,7
@@
avl_node_t *avl_search_node(const avl_tree_t * tree, const void *data)
return result ? NULL : node;
}
return result ? NULL : node;
}
-avl_node_t *avl_search_closest_node(const avl_tree_t *
tree, const void *data,
+avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data,
int *result)
{
avl_node_t *node;
int *result)
{
avl_node_t *node;
@@
-381,7
+381,7
@@
avl_node_t *avl_search_closest_node(const avl_tree_t * tree, const void *data,
return node;
}
return node;
}
-avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *
tree,
+avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *tree,
const void *data)
{
avl_node_t *node;
const void *data)
{
avl_node_t *node;
@@
-395,7
+395,7
@@
avl_node_t *avl_search_closest_smaller_node(const avl_tree_t * tree,
return node;
}
return node;
}
-avl_node_t *avl_search_closest_greater_node(const avl_tree_t *
tree,
+avl_node_t *avl_search_closest_greater_node(const avl_tree_t *tree,
const void *data)
{
avl_node_t *node;
const void *data)
{
avl_node_t *node;
@@
-411,7
+411,7
@@
avl_node_t *avl_search_closest_greater_node(const avl_tree_t * tree,
/* Insertion and deletion */
/* Insertion and deletion */
-avl_node_t *avl_insert(avl_tree_t *
tree, void *data)
+avl_node_t *avl_insert(avl_tree_t *tree, void *data)
{
avl_node_t *closest, *new;
int result;
{
avl_node_t *closest, *new;
int result;
@@
-451,7
+451,7
@@
avl_node_t *avl_insert(avl_tree_t * tree, void *data)
return new;
}
return new;
}
-avl_node_t *avl_insert_node(avl_tree_t *
tree, avl_node_t *
node)
+avl_node_t *avl_insert_node(avl_tree_t *
tree, avl_node_t *
node)
{
avl_node_t *closest;
int result;
{
avl_node_t *closest;
int result;
@@
-485,14
+485,14
@@
avl_node_t *avl_insert_node(avl_tree_t * tree, avl_node_t * node)
return node;
}
return node;
}
-void avl_insert_top(avl_tree_t *
tree, avl_node_t *
node)
+void avl_insert_top(avl_tree_t *
tree, avl_node_t *
node)
{
node->prev = node->next = node->parent = NULL;
tree->head = tree->tail = tree->root = node;
}
{
node->prev = node->next = node->parent = NULL;
tree->head = tree->tail = tree->root = node;
}
-void avl_insert_before(avl_tree_t *
tree, avl_node_t *
before,
- avl_node_t *
node)
+void avl_insert_before(avl_tree_t *
tree, avl_node_t *
before,
+ avl_node_t *node)
{
if(!before)
return tree->tail ? avl_insert_after(tree, tree->tail, node) : avl_insert_top(tree, node);
{
if(!before)
return tree->tail ? avl_insert_after(tree, tree->tail, node) : avl_insert_top(tree, node);
@@
-515,7
+515,7
@@
void avl_insert_before(avl_tree_t * tree, avl_node_t * before,
avl_rebalance(tree, before->parent);
}
avl_rebalance(tree, before->parent);
}
-void avl_insert_after(avl_tree_t *
tree, avl_node_t * after, avl_node_t *
node)
+void avl_insert_after(avl_tree_t *
tree, avl_node_t *after, avl_node_t *
node)
{
if(!after)
return tree->head ? avl_insert_before(tree, tree->head,
{
if(!after)
return tree->head ? avl_insert_before(tree, tree->head,
@@
-540,7
+540,7
@@
void avl_insert_after(avl_tree_t * tree, avl_node_t * after, avl_node_t * node)
avl_rebalance(tree, after->parent);
}
avl_rebalance(tree, after->parent);
}
-avl_node_t *avl_unlink(avl_tree_t *
tree, void *data)
+avl_node_t *avl_unlink(avl_tree_t *tree, void *data)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-552,7
+552,7
@@
avl_node_t *avl_unlink(avl_tree_t * tree, void *data)
return node;
}
return node;
}
-void avl_unlink_node(avl_tree_t *
tree, avl_node_t *
node)
+void avl_unlink_node(avl_tree_t *
tree, avl_node_t *
node)
{
avl_node_t *parent;
avl_node_t **superparent;
{
avl_node_t *parent;
avl_node_t **superparent;
@@
-621,13
+621,13
@@
void avl_unlink_node(avl_tree_t * tree, avl_node_t * node)
#endif
}
#endif
}
-void avl_delete_node(avl_tree_t *
tree, avl_node_t *
node)
+void avl_delete_node(avl_tree_t *
tree, avl_node_t *
node)
{
avl_unlink_node(tree, node);
avl_free_node(tree, node);
}
{
avl_unlink_node(tree, node);
avl_free_node(tree, node);
}
-void avl_delete(avl_tree_t *
tree, void *data)
+void avl_delete(avl_tree_t *tree, void *data)
{
avl_node_t *node;
{
avl_node_t *node;
@@
-639,7
+639,7
@@
void avl_delete(avl_tree_t * tree, void *data)
/* Fast tree cleanup */
/* Fast tree cleanup */
-void avl_delete_tree(avl_tree_t *
tree)
+void avl_delete_tree(avl_tree_t *tree)
{
avl_node_t *node, *next;
{
avl_node_t *node, *next;
@@
-653,7
+653,7
@@
void avl_delete_tree(avl_tree_t * tree)
/* Tree walking */
/* Tree walking */
-void avl_foreach(avl_tree_t *
tree, avl_action_t action)
+void avl_foreach(avl_tree_t *tree, avl_action_t action)
{
avl_node_t *node, *next;
{
avl_node_t *node, *next;
@@
-663,7
+663,7
@@
void avl_foreach(avl_tree_t * tree, avl_action_t action)
}
}
}
}
-void avl_foreach_node(avl_tree_t *
tree, avl_action_t action)
+void avl_foreach_node(avl_tree_t *tree, avl_action_t action)
{
avl_node_t *node, *next;
{
avl_node_t *node, *next;
@@
-676,12
+676,12
@@
void avl_foreach_node(avl_tree_t * tree, avl_action_t action)
/* Indexing */
#ifdef AVL_COUNT
/* Indexing */
#ifdef AVL_COUNT
-unsigned int avl_count(avl_tree_t *
tree)
+unsigned int avl_count(avl_tree_t *tree)
{
return AVL_NODE_COUNT(tree->root);
}
{
return AVL_NODE_COUNT(tree->root);
}
-avl_node_t *avl_get_node(const avl_tree_t *
tree, unsigned int index)
+avl_node_t *avl_get_node(const avl_tree_t *tree, unsigned int index)
{
avl_node_t *node;
unsigned int c;
{
avl_node_t *node;
unsigned int c;
@@
-704,7
+704,7
@@
avl_node_t *avl_get_node(const avl_tree_t * tree, unsigned int index)
return NULL;
}
return NULL;
}
-unsigned int avl_index(const avl_node_t *
node)
+unsigned int avl_index(const avl_node_t *node)
{
avl_node_t *next;
unsigned int index;
{
avl_node_t *next;
unsigned int index;
@@
-721,7
+721,7
@@
unsigned int avl_index(const avl_node_t * node)
}
#endif
#ifdef AVL_DEPTH
}
#endif
#ifdef AVL_DEPTH
-unsigned int avl_depth(avl_tree_t *
tree)
+unsigned int avl_depth(avl_tree_t *tree)
{
return AVL_NODE_DEPTH(tree->root);
}
{
return AVL_NODE_DEPTH(tree->root);
}
diff --git
a/lib/avl_tree.h
b/lib/avl_tree.h
index
08bed6b
..
f4eddaa
100644
(file)
--- a/
lib/avl_tree.h
+++ b/
lib/avl_tree.h
@@
-29,7
+29,7
@@
library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
- $Id: avl_tree.h,v 1.1.2.
6 2002/09/09 21:49:16
guus Exp $
+ $Id: avl_tree.h,v 1.1.2.
7 2002/09/09 22:32:27
guus Exp $
*/
*/
@@
-68,9
+68,9
@@
typedef struct avl_node_t {
} avl_node_t;
} avl_node_t;
-typedef int (*avl_compare_t)
(const void *, const void *);
-typedef void (*avl_action_t)
(const void *);
-typedef void (*avl_action_node_t)
(const avl_node_t *);
+typedef int (*avl_compare_t)(const void *, const void *);
+typedef void (*avl_action_t)(const void *);
+typedef void (*avl_action_node_t)(const avl_node_t *);
typedef struct avl_tree_t {
typedef struct avl_tree_t {
@@
-94,7
+94,7
@@
extern avl_tree_t *avl_alloc_tree(avl_compare_t, avl_action_t);
extern void avl_free_tree(avl_tree_t *);
extern avl_node_t *avl_alloc_node(void);
extern void avl_free_tree(avl_tree_t *);
extern avl_node_t *avl_alloc_node(void);
-extern void avl_free_node(avl_tree_t *
tree, avl_node_t *);
+extern void avl_free_node(avl_tree_t *tree, avl_node_t *);
/* Insertion and deletion */
/* Insertion and deletion */
@@
-106,7
+106,7
@@
extern void avl_insert_before(avl_tree_t *, avl_node_t *, avl_node_t *);
extern void avl_insert_after(avl_tree_t *, avl_node_t *, avl_node_t *);
extern avl_node_t *avl_unlink(avl_tree_t *, void *);
extern void avl_insert_after(avl_tree_t *, avl_node_t *, avl_node_t *);
extern avl_node_t *avl_unlink(avl_tree_t *, void *);
-extern void avl_unlink_node(avl_tree_t *
tree, avl_node_t *);
+extern void avl_unlink_node(avl_tree_t *tree, avl_node_t *);
extern void avl_delete(avl_tree_t *, void *);
extern void avl_delete_node(avl_tree_t *, avl_node_t *);
extern void avl_delete(avl_tree_t *, void *);
extern void avl_delete_node(avl_tree_t *, avl_node_t *);
diff --git
a/lib/list.c
b/lib/list.c
index
d47ce0e
..
4c4a3f6
100644
(file)
--- a/
lib/list.c
+++ b/
lib/list.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: list.c,v 1.1.2.1
2 2002/09/09 21:49:16
guus Exp $
+ $Id: list.c,v 1.1.2.1
3 2002/09/09 22:32:27
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-41,7
+41,7
@@
list_t *list_alloc(list_action_t delete)
return list;
}
return list;
}
-void list_free(list_t *
list)
+void list_free(list_t *list)
{
free(list);
}
{
free(list);
}
@@
-51,7
+51,7
@@
list_node_t *list_alloc_node(void)
return (list_node_t *)xmalloc_and_zero(sizeof(list_node_t));
}
return (list_node_t *)xmalloc_and_zero(sizeof(list_node_t));
}
-void list_free_node(list_t *
list, list_node_t *
node)
+void list_free_node(list_t *
list, list_node_t *
node)
{
if(node->data && list->delete)
list->delete(node->data);
{
if(node->data && list->delete)
list->delete(node->data);
@@
-61,7
+61,7
@@
void list_free_node(list_t * list, list_node_t * node)
/* Insertion and deletion */
/* Insertion and deletion */
-list_node_t *list_insert_head(list_t *
list, void *data)
+list_node_t *list_insert_head(list_t *list, void *data)
{
list_node_t *node;
{
list_node_t *node;
@@
-82,7
+82,7
@@
list_node_t *list_insert_head(list_t * list, void *data)
return node;
}
return node;
}
-list_node_t *list_insert_tail(list_t *
list, void *data)
+list_node_t *list_insert_tail(list_t *list, void *data)
{
list_node_t *node;
{
list_node_t *node;
@@
-103,7
+103,7
@@
list_node_t *list_insert_tail(list_t * list, void *data)
return node;
}
return node;
}
-void list_unlink_node(list_t *
list, list_node_t *
node)
+void list_unlink_node(list_t *
list, list_node_t *
node)
{
if(node->prev)
node->prev->next = node->next;
{
if(node->prev)
node->prev->next = node->next;
@@
-118,25
+118,25
@@
void list_unlink_node(list_t * list, list_node_t * node)
list->count--;
}
list->count--;
}
-void list_delete_node(list_t *
list, list_node_t *
node)
+void list_delete_node(list_t *
list, list_node_t *
node)
{
list_unlink_node(list, node);
list_free_node(list, node);
}
{
list_unlink_node(list, node);
list_free_node(list, node);
}
-void list_delete_head(list_t *
list)
+void list_delete_head(list_t *list)
{
list_delete_node(list, list->head);
}
{
list_delete_node(list, list->head);
}
-void list_delete_tail(list_t *
list)
+void list_delete_tail(list_t *list)
{
list_delete_node(list, list->tail);
}
/* Head/tail lookup */
{
list_delete_node(list, list->tail);
}
/* Head/tail lookup */
-void *list_get_head(list_t *
list)
+void *list_get_head(list_t *list)
{
if(list->head)
return list->head->data;
{
if(list->head)
return list->head->data;
@@
-144,7
+144,7
@@
void *list_get_head(list_t * list)
return NULL;
}
return NULL;
}
-void *list_get_tail(list_t *
list)
+void *list_get_tail(list_t *list)
{
if(list->tail)
return list->tail->data;
{
if(list->tail)
return list->tail->data;
@@
-154,7
+154,7
@@
void *list_get_tail(list_t * list)
/* Fast list deletion */
/* Fast list deletion */
-void list_delete_list(list_t *
list)
+void list_delete_list(list_t *list)
{
list_node_t *node, *next;
{
list_node_t *node, *next;
@@
-168,7
+168,7
@@
void list_delete_list(list_t * list)
/* Traversing */
/* Traversing */
-void list_foreach_node(list_t *
list, list_action_node_t action)
+void list_foreach_node(list_t *list, list_action_node_t action)
{
list_node_t *node, *next;
{
list_node_t *node, *next;
@@
-178,7
+178,7
@@
void list_foreach_node(list_t * list, list_action_node_t action)
}
}
}
}
-void list_foreach(list_t *
list, list_action_t action)
+void list_foreach(list_t *list, list_action_t action)
{
list_node_t *node, *next;
{
list_node_t *node, *next;
diff --git
a/lib/list.h
b/lib/list.h
index
326a929
..
df08e49
100644
(file)
--- a/
lib/list.h
+++ b/
lib/list.h
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: list.h,v 1.1.2.
7 2002/09/09 21:49:16
guus Exp $
+ $Id: list.h,v 1.1.2.
8 2002/09/09 22:32:27
guus Exp $
*/
#ifndef __TINC_LIST_H__
*/
#ifndef __TINC_LIST_H__
@@
-32,8
+32,8
@@
typedef struct list_node_t {
void *data;
} list_node_t;
void *data;
} list_node_t;
-typedef void (*list_action_t)
(const void *);
-typedef void (*list_action_node_t)
(const list_node_t *);
+typedef void (*list_action_t)(const void *);
+typedef void (*list_action_node_t)(const list_node_t *);
typedef struct list_t {
list_node_t *head;
typedef struct list_t {
list_node_t *head;
diff --git
a/src/conf.c
b/src/conf.c
index
192d04f
..
71f1c78
100644
(file)
--- a/
src/conf.c
+++ b/
src/conf.c
@@
-19,7
+19,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: conf.c,v 1.9.4.
59 2002/09/09 21:24:25
guus Exp $
+ $Id: conf.c,v 1.9.4.
60 2002/09/09 22:32:30
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-53,7
+53,7
@@
int pingtimeout = 0; /* seconds before timeout */
char *confbase = NULL; /* directory in which all config files are */
char *netname = NULL; /* name of the vpn network */
char *confbase = NULL; /* directory in which all config files are */
char *netname = NULL; /* name of the vpn network */
-int config_compare(config_t *
a, config_t *
b)
+int config_compare(config_t *
a, config_t *
b)
{
int result;
{
int result;
@@
-92,7
+92,7
@@
config_t *new_config(void)
return (config_t *) xmalloc_and_zero(sizeof(config_t));
}
return (config_t *) xmalloc_and_zero(sizeof(config_t));
}
-void free_config(config_t *
cfg)
+void free_config(config_t *cfg)
{
cp();
{
cp();
@@
-108,14
+108,14
@@
void free_config(config_t * cfg)
free(cfg);
}
free(cfg);
}
-void config_add(avl_tree_t *
config_tree, config_t *
cfg)
+void config_add(avl_tree_t *
config_tree, config_t *
cfg)
{
cp();
avl_insert(config_tree, cfg);
}
{
cp();
avl_insert(config_tree, cfg);
}
-config_t *lookup_config(avl_tree_t *
config_tree, char *variable)
+config_t *lookup_config(avl_tree_t *config_tree, char *variable)
{
config_t cfg, *found;
{
config_t cfg, *found;
@@
-136,7
+136,7
@@
config_t *lookup_config(avl_tree_t * config_tree, char *variable)
return found;
}
return found;
}
-config_t *lookup_config_next(avl_tree_t *
config_tree, config_t *
cfg)
+config_t *lookup_config_next(avl_tree_t *
config_tree, config_t *
cfg)
{
avl_node_t *node;
config_t *found;
{
avl_node_t *node;
config_t *found;
@@
-157,7
+157,7
@@
config_t *lookup_config_next(avl_tree_t * config_tree, config_t * cfg)
return NULL;
}
return NULL;
}
-int get_config_bool(config_t *
cfg, int *result)
+int get_config_bool(config_t *cfg, int *result)
{
cp();
{
cp();
@@
-178,7
+178,7
@@
int get_config_bool(config_t * cfg, int *result)
return 0;
}
return 0;
}
-int get_config_int(config_t *
cfg, int *result)
+int get_config_int(config_t *cfg, int *result)
{
cp();
{
cp();
@@
-194,7
+194,7
@@
int get_config_int(config_t * cfg, int *result)
return 0;
}
return 0;
}
-int get_config_string(config_t *
cfg, char **result)
+int get_config_string(config_t *cfg, char **result)
{
cp();
{
cp();
@@
-206,7
+206,7
@@
int get_config_string(config_t * cfg, char **result)
return 1;
}
return 1;
}
-int get_config_address(config_t *
cfg, struct addrinfo **result)
+int get_config_address(config_t *cfg, struct addrinfo **result)
{
struct addrinfo *ai;
{
struct addrinfo *ai;
@@
-228,7
+228,7
@@
int get_config_address(config_t * cfg, struct addrinfo **result)
return 0;
}
return 0;
}
-int get_config_port(config_t *
cfg, port_t *
result)
+int get_config_port(config_t *
cfg, port_t *
result)
{
cp();
{
cp();
@@
-246,7
+246,7
@@
int get_config_port(config_t * cfg, port_t * result)
return 0;
}
return 0;
}
-int get_config_subnet(config_t *
cfg, subnet_t ** result)
+int get_config_subnet(config_t *cfg, subnet_t ** result)
{
subnet_t *subnet;
{
subnet_t *subnet;
@@
-290,7
+290,7
@@
int get_config_subnet(config_t * cfg, subnet_t ** result)
given, and buf needs to be expanded, the var pointed to by buflen
will be increased.
*/
given, and buf needs to be expanded, the var pointed to by buflen
will be increased.
*/
-char *readline(FILE * fp, char **buf, size_t *
buflen)
+char *readline(FILE * fp, char **buf, size_t *buflen)
{
char *newline = NULL;
char *p;
{
char *newline = NULL;
char *p;
@@
-353,7
+353,7
@@
char *readline(FILE * fp, char **buf, size_t * buflen)
Parse a configuration file and put the results in the configuration tree
starting at *base.
*/
Parse a configuration file and put the results in the configuration tree
starting at *base.
*/
-int read_config_file(avl_tree_t *
config_tree, const char *fname)
+int read_config_file(avl_tree_t *config_tree, const char *fname)
{
int err = -2; /* Parse error */
FILE *fp;
{
int err = -2; /* Parse error */
FILE *fp;
diff --git
a/src/connection.c
b/src/connection.c
index
089ff0d
..
a35d4f0
100644
(file)
--- a/
src/connection.c
+++ b/
src/connection.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: connection.c,v 1.1.2.3
3 2002/09/09 21:24:31
guus Exp $
+ $Id: connection.c,v 1.1.2.3
4 2002/09/09 22:32:30
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-43,7
+43,7
@@
avl_tree_t *connection_tree; /* Meta connections */
connection_t *broadcast;
avl_tree_t *connection_tree; /* Meta connections */
connection_t *broadcast;
-int connection_compare(connection_t *
a, connection_t *
b)
+int connection_compare(connection_t *
a, connection_t *
b)
{
return a - b;
}
{
return a - b;
}
@@
-82,7
+82,7
@@
connection_t *new_connection(void)
return c;
}
return c;
}
-void free_connection(connection_t *
c)
+void free_connection(connection_t *c)
{
cp();
{
cp();
@@
-104,14
+104,14
@@
void free_connection(connection_t * c)
free(c);
}
free(c);
}
-void connection_add(connection_t *
c)
+void connection_add(connection_t *c)
{
cp();
avl_insert(connection_tree, c);
}
{
cp();
avl_insert(connection_tree, c);
}
-void connection_del(connection_t *
c)
+void connection_del(connection_t *c)
{
cp();
{
cp();
@@
-136,7
+136,7
@@
void dump_connections(void)
syslog(LOG_DEBUG, _("End of connections."));
}
syslog(LOG_DEBUG, _("End of connections."));
}
-int read_connection_config(connection_t *
c)
+int read_connection_config(connection_t *c)
{
char *fname;
int x;
{
char *fname;
int x;
diff --git
a/src/cygwin/device.c
b/src/cygwin/device.c
index
b14aec1
..
7cc8b1c
100644
(file)
--- a/
src/cygwin/device.c
+++ b/
src/cygwin/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
2 2002/09/09 21:25:18
guus Exp $
+ $Id: device.c,v 1.1.2.
3 2002/09/09 22:33:21
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-83,7
+83,7
@@
void close_device(void)
cp close(device_fd);
}
cp close(device_fd);
}
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
@@
-104,7
+104,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/darwin/device.c
b/src/darwin/device.c
index
d30f0b6
..
99741f6
100644
(file)
--- a/
src/darwin/device.c
+++ b/
src/darwin/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
3 2002/09/09 21:25:19
guus Exp $
+ $Id: device.c,v 1.1.2.
4 2002/09/09 22:33:23
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-92,7
+92,7
@@
void close_device(void)
read, encrypt and send data that is
available through the ethertap device
*/
read, encrypt and send data that is
available through the ethertap device
*/
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
@@
-117,7
+117,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/edge.c
b/src/edge.c
index
8c10009
..
9cc9df8
100644
(file)
--- a/
src/edge.c
+++ b/
src/edge.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: edge.c,v 1.1.2.1
6 2002/09/09 21:24:31
guus Exp $
+ $Id: edge.c,v 1.1.2.1
7 2002/09/09 22:32:30
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-43,12
+43,12
@@
avl_tree_t *edge_weight_tree; /* Tree with all edges, sorted on weight */
avl_tree_t *edge_weight_tree; /* Tree with all edges, sorted on weight */
-int edge_compare(edge_t *
a, edge_t *
b)
+int edge_compare(edge_t *
a, edge_t *
b)
{
return strcmp(a->to->name, b->to->name);
}
{
return strcmp(a->to->name, b->to->name);
}
-int edge_weight_compare(edge_t *
a, edge_t *
b)
+int edge_weight_compare(edge_t *
a, edge_t *
b)
{
int result;
{
int result;
@@
-80,7
+80,7
@@
avl_tree_t *new_edge_tree(void)
return avl_alloc_tree((avl_compare_t) edge_compare, NULL);
}
return avl_alloc_tree((avl_compare_t) edge_compare, NULL);
}
-void free_edge_tree(avl_tree_t *
edge_tree)
+void free_edge_tree(avl_tree_t *edge_tree)
{
cp();
{
cp();
@@
-103,14
+103,14
@@
edge_t *new_edge(void)
return (edge_t *) xmalloc_and_zero(sizeof(edge_t));
}
return (edge_t *) xmalloc_and_zero(sizeof(edge_t));
}
-void free_edge(edge_t *
e)
+void free_edge(edge_t *e)
{
cp();
free(e);
}
{
cp();
free(e);
}
-void edge_add(edge_t *
e)
+void edge_add(edge_t *e)
{
cp();
{
cp();
@@
-123,7
+123,7
@@
void edge_add(edge_t * e)
e->reverse->reverse = e;
}
e->reverse->reverse = e;
}
-void edge_del(edge_t *
e)
+void edge_del(edge_t *e)
{
cp();
{
cp();
@@
-134,7
+134,7
@@
void edge_del(edge_t * e)
avl_delete(edge_weight_tree, e);
}
avl_delete(edge_weight_tree, e);
}
-edge_t *lookup_edge(node_t *
from, node_t *
to)
+edge_t *lookup_edge(node_t *
from, node_t *
to)
{
edge_t v;
{
edge_t v;
diff --git
a/src/event.c
b/src/event.c
index
acf2ffb
..
a91be86
100644
(file)
--- a/
src/event.c
+++ b/
src/event.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: event.c,v 1.1.4.
5 2002/09/09 21:24:31
guus Exp $
+ $Id: event.c,v 1.1.4.
6 2002/09/09 22:32:30
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-38,7
+38,7
@@
extern time_t now;
int id;
int id;
-int event_compare(event_t *
a, event_t *
b)
+int event_compare(event_t *
a, event_t *
b)
{
if(a->time > b->time)
return 1;
{
if(a->time > b->time)
return 1;
@@
-70,14
+70,14
@@
event_t *new_event(void)
return (event_t *) xmalloc_and_zero(sizeof(event_t));
}
return (event_t *) xmalloc_and_zero(sizeof(event_t));
}
-void free_event(event_t *
event)
+void free_event(event_t *event)
{
cp();
free(event);
}
{
cp();
free(event);
}
-void event_add(event_t *
event)
+void event_add(event_t *event)
{
cp();
{
cp();
@@
-85,7
+85,7
@@
void event_add(event_t * event)
avl_insert(event_tree, event);
}
avl_insert(event_tree, event);
}
-void event_del(event_t *
event)
+void event_del(event_t *event)
{
cp();
{
cp();
diff --git
a/src/event.h
b/src/event.h
index
5833ad1
..
25eb966
100644
(file)
--- a/
src/event.h
+++ b/
src/event.h
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: event.h,v 1.1.4.
3 2002/09/09 21:24:34
guus Exp $
+ $Id: event.h,v 1.1.4.
4 2002/09/09 22:32:36
guus Exp $
*/
#ifndef __TINC_EVENT_H__
*/
#ifndef __TINC_EVENT_H__
@@
-28,7
+28,7
@@
avl_tree_t *event_tree;
avl_tree_t *event_tree;
-typedef void (*event_handler_t)
(void *);
+typedef void (*event_handler_t)(void *);
typedef struct {
time_t time;
typedef struct {
time_t time;
diff --git
a/src/freebsd/device.c
b/src/freebsd/device.c
index
0e3a9fc
..
074f347
100644
(file)
--- a/
src/freebsd/device.c
+++ b/
src/freebsd/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
6 2002/09/09 21:25:19
guus Exp $
+ $Id: device.c,v 1.1.2.
7 2002/09/09 22:33:23
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-92,7
+92,7
@@
void close_device(void)
read, encrypt and send data that is
available through the ethertap device
*/
read, encrypt and send data that is
available through the ethertap device
*/
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
@@
-112,7
+112,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/linux/device.c
b/src/linux/device.c
index
0391f6a
..
92b3a3c
100644
(file)
--- a/
src/linux/device.c
+++ b/
src/linux/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.1
1 2002/09/09 21:25:23
guus Exp $
+ $Id: device.c,v 1.1.2.1
2 2002/09/09 22:33:24
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-73,7
+73,9
@@
int setup_device(void)
{
struct ifreq ifr;
{
struct ifreq ifr;
- cp if(!get_config_string(lookup_config(config_tree, "Device"), &device))
+ cp();
+
+ if(!get_config_string(lookup_config(config_tree, "Device"), &device))
device = DEFAULT_DEVICE;
if(!get_config_string(lookup_config(config_tree, "Interface"), &interface))
device = DEFAULT_DEVICE;
if(!get_config_string(lookup_config(config_tree, "Interface"), &interface))
@@
-82,15
+84,15
@@
int setup_device(void)
#else
interface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
#endif
#else
interface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
#endif
-
cp
device_fd = open(device, O_RDWR | O_NONBLOCK);
+ device_fd = open(device, O_RDWR | O_NONBLOCK);
if(device_fd < 0) {
syslog(LOG_ERR, _("Could not open %s: %s"), device, strerror(errno));
return -1;
}
if(device_fd < 0) {
syslog(LOG_ERR, _("Could not open %s: %s"), device, strerror(errno));
return -1;
}
- cp
-
/* Set default MAC address for ethertap devices */
-
mymac.type = SUBNET_MAC;
+
+ /* Set default MAC address for ethertap devices */
+ mymac.type = SUBNET_MAC;
mymac.net.mac.address.x[0] = 0xfe;
mymac.net.mac.address.x[1] = 0xfd;
mymac.net.mac.address.x[2] = 0x00;
mymac.net.mac.address.x[0] = 0xfe;
mymac.net.mac.address.x[1] = 0xfd;
mymac.net.mac.address.x[2] = 0x00;
@@
-102,10
+104,12
@@
int setup_device(void)
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
memset(&ifr, 0, sizeof(ifr));
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
memset(&ifr, 0, sizeof(ifr));
- cp ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+
if(interface)
strncpy(ifr.ifr_name, interface, IFNAMSIZ);
if(interface)
strncpy(ifr.ifr_name, interface, IFNAMSIZ);
- cp if(!ioctl(device_fd, TUNSETIFF, (void *) &ifr)) {
+
+ if(!ioctl(device_fd, TUNSETIFF, (void *) &ifr)) {
device_info = _("Linux tun/tap device");
device_type = DEVICE_TYPE_TUNTAP;
strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
device_info = _("Linux tun/tap device");
device_type = DEVICE_TYPE_TUNTAP;
strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
@@
-125,22
+129,28
@@
int setup_device(void)
}
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
}
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
- cp return 0;
+
+ return 0;
}
void close_device(void)
{
}
void close_device(void)
{
- cp close(device_fd);
+ cp();
+
+ close(device_fd);
}
/*
read, encrypt and send data that is
available through the ethertap device
*/
}
/*
read, encrypt and send data that is
available through the ethertap device
*/
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
{
int lenin;
- cp if(device_type == DEVICE_TYPE_TUNTAP) {
+
+ cp();
+
+ if(device_type == DEVICE_TYPE_TUNTAP) {
lenin = read(device_fd, packet->data, MTU);
if(lenin <= 0) {
lenin = read(device_fd, packet->data, MTU);
if(lenin <= 0) {
@@
-171,11
+181,13
@@
int read_packet(vpn_packet_t * packet)
}
return 0;
}
return 0;
-
cp
}
+}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
{
- cp if(debug_lvl >= DEBUG_TRAFFIC)
+ cp();
+
+ if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
packet->len, device_info);
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
packet->len, device_info);
@@
-186,8
+198,8
@@
int write_packet(vpn_packet_t * packet)
return -1;
}
} else { /* ethertap */
return -1;
}
} else { /* ethertap */
+ *(short int *)(packet->data - 2) = packet->len;
- *(short int *) (packet->data - 2) = packet->len;
if(write(device_fd, packet->data - 2, packet->len + 2) < 0) {
syslog(LOG_ERR, _("Can't write to %s %s: %s"), device_info, device,
strerror(errno));
if(write(device_fd, packet->data - 2, packet->len + 2) < 0) {
syslog(LOG_ERR, _("Can't write to %s %s: %s"), device_info, device,
strerror(errno));
@@
-196,12
+208,15
@@
int write_packet(vpn_packet_t * packet)
}
device_total_out += packet->len;
}
device_total_out += packet->len;
- cp return 0;
+
+ return 0;
}
void dump_device_stats(void)
{
}
void dump_device_stats(void)
{
- cp syslog(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
+ cp();
+
+ syslog(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
syslog(LOG_DEBUG, _(" total bytes in: %10d"), device_total_in);
syslog(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
syslog(LOG_DEBUG, _(" total bytes in: %10d"), device_total_in);
syslog(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
-
cp
}
+}
diff --git
a/src/meta.c
b/src/meta.c
index
fa475df
..
bf6cc4c
100644
(file)
--- a/
src/meta.c
+++ b/
src/meta.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: meta.c,v 1.1.2.
29 2002/09/09 21:24:34
guus Exp $
+ $Id: meta.c,v 1.1.2.
30 2002/09/09 22:32:39
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-39,7
+39,7
@@
#include "system.h"
#include "protocol.h"
#include "system.h"
#include "protocol.h"
-int send_meta(connection_t *
c, char *buffer, int length)
+int send_meta(connection_t *c, char *buffer, int length)
{
char *bufp;
int outlen;
{
char *bufp;
int outlen;
@@
-67,7
+67,7
@@
int send_meta(connection_t * c, char *buffer, int length)
return 0;
}
return 0;
}
-void broadcast_meta(connection_t *
from, char *buffer, int length)
+void broadcast_meta(connection_t *from, char *buffer, int length)
{
avl_node_t *node;
connection_t *c;
{
avl_node_t *node;
connection_t *c;
@@
-82,7
+82,7
@@
void broadcast_meta(connection_t * from, char *buffer, int length)
}
}
}
}
-int receive_meta(connection_t *
c)
+int receive_meta(connection_t *c)
{
int x, l = sizeof(x);
int oldlen, i;
{
int x, l = sizeof(x);
int oldlen, i;
diff --git
a/src/net.c
b/src/net.c
index
5cd3fa5
..
c56fe98
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.18
0 2002/09/09 21:24:34
guus Exp $
+ $Id: net.c,v 1.35.4.18
1 2002/09/09 22:32:39
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-166,7
+166,7
@@
void build_fdset(fd_set * fs)
- Check if we need to retry making an outgoing connection
- Deactivate the host
*/
- Check if we need to retry making an outgoing connection
- Deactivate the host
*/
-void terminate_connection(connection_t *
c, int report)
+void terminate_connection(connection_t *c, int report)
{
cp();
{
cp();
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
00733b6
..
eaa2cf1
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_packet.c,v 1.1.2.2
2 2002/09/09 21:24:41
guus Exp $
+ $Id: net_packet.c,v 1.1.2.2
3 2002/09/09 22:32:44
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-85,7
+85,7
@@
int keyexpires = 0;
/* VPN packet I/O */
/* VPN packet I/O */
-void receive_udppacket(node_t *
n, vpn_packet_t *
inpkt)
+void receive_udppacket(node_t *
n, vpn_packet_t *
inpkt)
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
@@
-164,7
+164,7
@@
void receive_udppacket(node_t * n, vpn_packet_t * inpkt)
receive_packet(n, inpkt);
}
receive_packet(n, inpkt);
}
-void receive_tcppacket(connection_t *
c, char *buffer, int len)
+void receive_tcppacket(connection_t *c, char *buffer, int len)
{
vpn_packet_t outpkt;
{
vpn_packet_t outpkt;
@@
-176,7
+176,7
@@
void receive_tcppacket(connection_t * c, char *buffer, int len)
receive_packet(c->node, &outpkt);
}
receive_packet(c->node, &outpkt);
}
-void receive_packet(node_t *
n, vpn_packet_t *
packet)
+void receive_packet(node_t *
n, vpn_packet_t *
packet)
{
cp();
{
cp();
@@
-187,7
+187,7
@@
void receive_packet(node_t * n, vpn_packet_t * packet)
route_incoming(n, packet);
}
route_incoming(n, packet);
}
-void send_udppacket(node_t *
n, vpn_packet_t *
inpkt)
+void send_udppacket(node_t *
n, vpn_packet_t *
inpkt)
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
@@
-313,7
+313,7
@@
void send_udppacket(node_t * n, vpn_packet_t * inpkt)
/*
send a packet to the given vpn ip.
*/
/*
send a packet to the given vpn ip.
*/
-void send_packet(node_t *
n, vpn_packet_t *
packet)
+void send_packet(node_t *
n, vpn_packet_t *
packet)
{
node_t *via;
{
node_t *via;
@@
-353,7
+353,7
@@
void send_packet(node_t * n, vpn_packet_t * packet)
/* Broadcast a packet using the minimum spanning tree */
/* Broadcast a packet using the minimum spanning tree */
-void broadcast_packet(node_t *
from, vpn_packet_t *
packet)
+void broadcast_packet(node_t *
from, vpn_packet_t *
packet)
{
avl_node_t *node;
connection_t *c;
{
avl_node_t *node;
connection_t *c;
@@
-372,7
+372,7
@@
void broadcast_packet(node_t * from, vpn_packet_t * packet)
}
}
}
}
-void flush_queue(node_t *
n)
+void flush_queue(node_t *n)
{
list_node_t *node, *next;
{
list_node_t *node, *next;
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
eee0560
..
5243b1e
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_setup.c,v 1.1.2.2
5 2002/09/09 21:24:41
guus Exp $
+ $Id: net_setup.c,v 1.1.2.2
6 2002/09/09 22:32:44
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-77,7
+77,7
@@
char *myport;
char *myport;
-int read_rsa_public_key(connection_t *
c)
+int read_rsa_public_key(connection_t *c)
{
FILE *fp;
char *fname;
{
FILE *fp;
char *fname;
diff --git
a/src/net_socket.c
b/src/net_socket.c
index
96a58b0
..
eedef7b
100644
(file)
--- a/
src/net_socket.c
+++ b/
src/net_socket.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_socket.c,v 1.1.2.2
0 2002/09/09 21:24:41
guus Exp $
+ $Id: net_socket.c,v 1.1.2.2
1 2002/09/09 22:32:44
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-84,7
+84,7
@@
int listen_sockets;
/* Setup sockets */
/* Setup sockets */
-int setup_listen_socket(sockaddr_t *
sa)
+int setup_listen_socket(sockaddr_t *sa)
{
int nfd, flags;
char *addrstr;
{
int nfd, flags;
char *addrstr;
@@
-162,7
+162,7
@@
int setup_listen_socket(sockaddr_t * sa)
return nfd;
}
return nfd;
}
-int setup_vpn_in_socket(sockaddr_t *
sa)
+int setup_vpn_in_socket(sockaddr_t *sa)
{
int nfd, flags;
char *addrstr;
{
int nfd, flags;
char *addrstr;
@@
-219,7
+219,7
@@
int setup_vpn_in_socket(sockaddr_t * sa)
return nfd;
}
return nfd;
}
-void retry_outgoing(outgoing_t *
outgoing)
+void retry_outgoing(outgoing_t *outgoing)
{
event_t *event;
{
event_t *event;
@@
-242,7
+242,7
@@
void retry_outgoing(outgoing_t * outgoing)
outgoing->timeout);
}
outgoing->timeout);
}
-int setup_outgoing_socket(connection_t *
c)
+int setup_outgoing_socket(connection_t *c)
{
int option;
{
int option;
@@
-288,7
+288,7
@@
int setup_outgoing_socket(connection_t * c)
}
}
-void finish_connecting(connection_t *
c)
+void finish_connecting(connection_t *c)
{
cp();
{
cp();
@@
-300,7
+300,7
@@
void finish_connecting(connection_t * c)
send_id(c);
}
send_id(c);
}
-void do_outgoing_connection(connection_t *
c)
+void do_outgoing_connection(connection_t *c)
{
char *address, *port;
int option, result, flags;
{
char *address, *port;
int option, result, flags;
@@
-403,7
+403,7
@@
begin:
return;
}
return;
}
-void setup_outgoing_connection(outgoing_t *
outgoing)
+void setup_outgoing_connection(outgoing_t *outgoing)
{
connection_t *c;
node_t *n;
{
connection_t *c;
node_t *n;
diff --git
a/src/netbsd/device.c
b/src/netbsd/device.c
index
53bd9da
..
232e58d
100644
(file)
--- a/
src/netbsd/device.c
+++ b/
src/netbsd/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
5 2002/09/09 21:25:23
guus Exp $
+ $Id: device.c,v 1.1.2.
6 2002/09/09 22:33:24
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-93,7
+93,7
@@
void close_device(void)
cp close(device_fd);
cp}
cp close(device_fd);
cp}
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
@@
-119,7
+119,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/netutl.c
b/src/netutl.c
index
e5c969e
..
c977316
100644
(file)
--- a/
src/netutl.c
+++ b/
src/netutl.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: netutl.c,v 1.12.4.4
3 2002/09/09 21:24:41
guus Exp $
+ $Id: netutl.c,v 1.12.4.4
4 2002/09/09 22:32:44
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-107,7
+107,7
@@
sockaddr_t str2sockaddr(char *address, char *port)
return result;
}
return result;
}
-void sockaddr2str(sockaddr_t *
sa, char **addrstr, char **portstr)
+void sockaddr2str(sockaddr_t *sa, char **addrstr, char **portstr)
{
char address[NI_MAXHOST];
char port[NI_MAXSERV];
{
char address[NI_MAXHOST];
char port[NI_MAXSERV];
@@
-135,7
+135,7
@@
void sockaddr2str(sockaddr_t * sa, char **addrstr, char **portstr)
*portstr = xstrdup(port);
}
*portstr = xstrdup(port);
}
-char *sockaddr2hostname(sockaddr_t *
sa)
+char *sockaddr2hostname(sockaddr_t *sa)
{
char *str;
char address[NI_MAXHOST] = "unknown";
{
char *str;
char address[NI_MAXHOST] = "unknown";
@@
-156,7
+156,7
@@
char *sockaddr2hostname(sockaddr_t * sa)
return str;
}
return str;
}
-int sockaddrcmp(sockaddr_t *
a, sockaddr_t *
b)
+int sockaddrcmp(sockaddr_t *
a, sockaddr_t *
b)
{
int result;
{
int result;
@@
-196,7
+196,7
@@
int sockaddrcmp(sockaddr_t * a, sockaddr_t * b)
}
}
}
}
-void sockaddrunmap(sockaddr_t *
sa)
+void sockaddrunmap(sockaddr_t *sa)
{
if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr)) {
sa->in.sin_addr.s_addr = ((uint32_t *) & sa->in6.sin6_addr)[3];
{
if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr)) {
sa->in.sin_addr.s_addr = ((uint32_t *) & sa->in6.sin6_addr)[3];
diff --git
a/src/node.c
b/src/node.c
index
89b1689
..
e68c735
100644
(file)
--- a/
src/node.c
+++ b/
src/node.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: node.c,v 1.1.2.1
7 2002/09/09 21:24:41
guus Exp $
+ $Id: node.c,v 1.1.2.1
8 2002/09/09 22:32:49
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-39,12
+39,12
@@
avl_tree_t *node_udp_tree; /* Known nodes, sorted by address and port */
node_t *myself;
node_t *myself;
-int node_compare(node_t *
a, node_t *
b)
+int node_compare(node_t *
a, node_t *
b)
{
return strcmp(a->name, b->name);
}
{
return strcmp(a->name, b->name);
}
-int node_udp_compare(node_t *
a, node_t *
b)
+int node_udp_compare(node_t *
a, node_t *
b)
{
int result;
{
int result;
@@
-87,7
+87,7
@@
node_t *new_node(void)
return n;
}
return n;
}
-void free_node(node_t *
n)
+void free_node(node_t *n)
{
cp();
{
cp();
@@
-112,7
+112,7
@@
void free_node(node_t * n)
free(n);
}
free(n);
}
-void node_add(node_t *
n)
+void node_add(node_t *n)
{
cp();
{
cp();
@@
-120,7
+120,7
@@
void node_add(node_t * n)
avl_insert(node_udp_tree, n);
}
avl_insert(node_udp_tree, n);
}
-void node_del(node_t *
n)
+void node_del(node_t *n)
{
avl_node_t *node, *next;
edge_t *e;
{
avl_node_t *node, *next;
edge_t *e;
@@
-152,7
+152,7
@@
node_t *lookup_node(char *name)
return avl_search(node_tree, &n);
}
return avl_search(node_tree, &n);
}
-node_t *lookup_node_udp(sockaddr_t *
sa)
+node_t *lookup_node_udp(sockaddr_t *sa)
{
node_t n;
cp();
{
node_t n;
cp();
diff --git
a/src/openbsd/device.c
b/src/openbsd/device.c
index
dee8fa0
..
48d8b9b
100644
(file)
--- a/
src/openbsd/device.c
+++ b/
src/openbsd/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.1
0 2002/09/09 21:25:26
guus Exp $
+ $Id: device.c,v 1.1.2.1
1 2002/09/09 22:33:27
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-93,7
+93,7
@@
void close_device(void)
cp close(device_fd);
cp}
cp close(device_fd);
cp}
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
u_int32_t type;
{
int lenin;
u_int32_t type;
@@
-139,7
+139,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
u_int32_t type;
struct iovec vector[2];
{
u_int32_t type;
struct iovec vector[2];
diff --git
a/src/process.c
b/src/process.c
index
f149d7c
..
46a8de8
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.c,v 1.1.2.4
6 2002/09/09 21:24:41
guus Exp $
+ $Id: process.c,v 1.1.2.4
7 2002/09/09 22:32:49
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-423,7
+423,7
@@
RETSIGTYPE ignore_signal_handler(int a)
struct {
int signal;
struct {
int signal;
- void (*handler)
(int);
+ void (*handler)(int);
} sighandlers[] = {
{
SIGHUP, sighup_handler}, {
} sighandlers[] = {
{
SIGHUP, sighup_handler}, {
diff --git
a/src/protocol.c
b/src/protocol.c
index
565087c
..
b499c48
100644
(file)
--- a/
src/protocol.c
+++ b/
src/protocol.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol.c,v 1.28.4.13
6 2002/09/09 21:24:41
guus Exp $
+ $Id: protocol.c,v 1.28.4.13
7 2002/09/09 22:32:49
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-57,7
+57,7
@@
int check_id(char *id)
/* Generic request routines - takes care of logging and error
detection as well */
/* Generic request routines - takes care of logging and error
detection as well */
-int send_request(connection_t *
c, const char *format, ...)
+int send_request(connection_t *c, const char *format, ...)
{
va_list args;
char buffer[MAXBUFSIZE];
{
va_list args;
char buffer[MAXBUFSIZE];
@@
-97,7
+97,7
@@
int send_request(connection_t * c, const char *format, ...)
return send_meta(c, buffer, len);
}
return send_meta(c, buffer, len);
}
-int forward_request(connection_t *
from)
+int forward_request(connection_t *from)
{
int request;
cp();
{
int request;
cp();
@@
-120,7
+120,7
@@
int forward_request(connection_t * from)
return broadcast_meta(from, from->buffer, from->reqlen);
}
return broadcast_meta(from, from->buffer, from->reqlen);
}
-int receive_request(connection_t *
c)
+int receive_request(connection_t *c)
{
int request;
{
int request;
@@
-170,12
+170,12
@@
int receive_request(connection_t * c)
return 0;
}
return 0;
}
-int past_request_compare(past_request_t *
a, past_request_t *
b)
+int past_request_compare(past_request_t *
a, past_request_t *
b)
{
return strcmp(a->request, b->request);
}
{
return strcmp(a->request, b->request);
}
-void free_past_request(past_request_t *
r)
+void free_past_request(past_request_t *r)
{
cp();
{
cp();
@@
-245,7
+245,7
@@
void age_past_requests(void)
/* Jumptable for the request handlers */
/* Jumptable for the request handlers */
-int (*request_handlers[])
(connection_t *) = {
+int (*request_handlers[])(connection_t *) = {
id_h, metakey_h, challenge_h, chal_reply_h, ack_h,
status_h, error_h, termreq_h,
ping_h, pong_h,
id_h, metakey_h, challenge_h, chal_reply_h, ack_h,
status_h, error_h, termreq_h,
ping_h, pong_h,
diff --git
a/src/protocol.h
b/src/protocol.h
index
f782523
..
db1c96c
100644
(file)
--- a/
src/protocol.h
+++ b/
src/protocol.h
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol.h,v 1.5.4.3
5 2002/09/09 21:24:42
guus Exp $
+ $Id: protocol.h,v 1.5.4.3
6 2002/09/09 22:32:55
guus Exp $
*/
#ifndef __TINC_PROTOCOL_H__
*/
#ifndef __TINC_PROTOCOL_H__
@@
-93,7
+93,7
@@
extern int send_tcppacket(connection_t *, vpn_packet_t *);
/* Request handlers */
/* Request handlers */
-extern int (*request_handlers[])
(connection_t *);
+extern int (*request_handlers[])(connection_t *);
extern int id_h(connection_t *);
extern int metakey_h(connection_t *);
extern int id_h(connection_t *);
extern int metakey_h(connection_t *);
diff --git
a/src/protocol_auth.c
b/src/protocol_auth.c
index
fc0c3aa
..
83b1c20
100644
(file)
--- a/
src/protocol_auth.c
+++ b/
src/protocol_auth.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_auth.c,v 1.1.4.1
6 2002/09/09 21:24:45
guus Exp $
+ $Id: protocol_auth.c,v 1.1.4.1
7 2002/09/09 22:32:59
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-53,7
+53,7
@@
#include "system.h"
#include "system.h"
-int send_id(connection_t *
c)
+int send_id(connection_t *c)
{
cp();
{
cp();
@@
-61,7
+61,7
@@
int send_id(connection_t * c)
myself->connection->protocol_version);
}
myself->connection->protocol_version);
}
-int id_h(connection_t *
c)
+int id_h(connection_t *c)
{
char name[MAX_STRING_SIZE];
int bla;
{
char name[MAX_STRING_SIZE];
int bla;
@@
-137,7
+137,7
@@
int id_h(connection_t * c)
return send_metakey(c);
}
return send_metakey(c);
}
-int send_metakey(connection_t *
c)
+int send_metakey(connection_t *c)
{
char buffer[MAX_STRING_SIZE];
int len, x;
{
char buffer[MAX_STRING_SIZE];
int len, x;
@@
-216,7
+216,7
@@
int send_metakey(connection_t * c)
return x;
}
return x;
}
-int metakey_h(connection_t *
c)
+int metakey_h(connection_t *c)
{
char buffer[MAX_STRING_SIZE];
int cipher, digest, maclength, compression;
{
char buffer[MAX_STRING_SIZE];
int cipher, digest, maclength, compression;
@@
-319,7
+319,7
@@
int metakey_h(connection_t * c)
return send_challenge(c);
}
return send_challenge(c);
}
-int send_challenge(connection_t *
c)
+int send_challenge(connection_t *c)
{
char buffer[MAX_STRING_SIZE];
int len, x;
{
char buffer[MAX_STRING_SIZE];
int len, x;
@@
-351,7
+351,7
@@
int send_challenge(connection_t * c)
return x;
}
return x;
}
-int challenge_h(connection_t *
c)
+int challenge_h(connection_t *c)
{
char buffer[MAX_STRING_SIZE];
int len;
{
char buffer[MAX_STRING_SIZE];
int len;
@@
-390,7
+390,7
@@
int challenge_h(connection_t * c)
return send_chal_reply(c);
}
return send_chal_reply(c);
}
-int send_chal_reply(connection_t *
c)
+int send_chal_reply(connection_t *c)
{
char hash[EVP_MAX_MD_SIZE * 2 + 1];
EVP_MD_CTX ctx;
{
char hash[EVP_MAX_MD_SIZE * 2 + 1];
EVP_MD_CTX ctx;
@@
-414,7
+414,7
@@
int send_chal_reply(connection_t * c)
return send_request(c, "%d %s", CHAL_REPLY, hash);
}
return send_request(c, "%d %s", CHAL_REPLY, hash);
}
-int chal_reply_h(connection_t *
c)
+int chal_reply_h(connection_t *c)
{
char hishash[MAX_STRING_SIZE];
char myhash[EVP_MAX_MD_SIZE];
{
char hishash[MAX_STRING_SIZE];
char myhash[EVP_MAX_MD_SIZE];
@@
-470,7
+470,7
@@
int chal_reply_h(connection_t * c)
return send_ack(c);
}
return send_ack(c);
}
-int send_ack(connection_t *
c)
+int send_ack(connection_t *c)
{
/* ACK message contains rest of the information the other end needs
to create node_t and edge_t structures. */
{
/* ACK message contains rest of the information the other end needs
to create node_t and edge_t structures. */
@@
-492,7
+492,7
@@
int send_ack(connection_t * c)
return x;
}
return x;
}
-void send_everything(connection_t *
c)
+void send_everything(connection_t *c)
{
avl_node_t *node, *node2;
node_t *n;
{
avl_node_t *node, *node2;
node_t *n;
@@
-516,7
+516,7
@@
void send_everything(connection_t * c)
}
}
}
}
-int ack_h(connection_t *
c)
+int ack_h(connection_t *c)
{
char hisport[MAX_STRING_SIZE];
char *hisaddress, *dummy;
{
char hisport[MAX_STRING_SIZE];
char *hisaddress, *dummy;
diff --git
a/src/protocol_edge.c
b/src/protocol_edge.c
index
bd473f1
..
6129f71
100644
(file)
--- a/
src/protocol_edge.c
+++ b/
src/protocol_edge.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_edge.c,v 1.1.4.1
2 2002/09/09 21:24:48
guus Exp $
+ $Id: protocol_edge.c,v 1.1.4.1
3 2002/09/09 22:33:02
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-45,7
+45,7
@@
#include "system.h"
#include "system.h"
-int send_add_edge(connection_t *
c, edge_t *
e)
+int send_add_edge(connection_t *
c, edge_t *
e)
{
int x;
char *address, *port;
{
int x;
char *address, *port;
@@
-63,7
+63,7
@@
int send_add_edge(connection_t * c, edge_t * e)
return x;
}
return x;
}
-int add_edge_h(connection_t *
c)
+int add_edge_h(connection_t *c)
{
edge_t *e;
node_t *from, *to;
{
edge_t *e;
node_t *from, *to;
@@
-174,7
+174,7
@@
int add_edge_h(connection_t * c)
return 0;
}
return 0;
}
-int send_del_edge(connection_t *
c, edge_t *
e)
+int send_del_edge(connection_t *
c, edge_t *
e)
{
cp();
{
cp();
@@
-182,7
+182,7
@@
int send_del_edge(connection_t * c, edge_t * e)
e->from->name, e->to->name);
}
e->from->name, e->to->name);
}
-int del_edge_h(connection_t *
c)
+int del_edge_h(connection_t *c)
{
edge_t *e;
char from_name[MAX_STRING_SIZE];
{
edge_t *e;
char from_name[MAX_STRING_SIZE];
diff --git
a/src/protocol_key.c
b/src/protocol_key.c
index
66c9a90
..
2453975
100644
(file)
--- a/
src/protocol_key.c
+++ b/
src/protocol_key.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_key.c,v 1.1.4.1
3 2002/09/09 21:24:56
guus Exp $
+ $Id: protocol_key.c,v 1.1.4.1
4 2002/09/09 22:33:03
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-45,7
+45,7
@@
int mykeyused = 0;
int mykeyused = 0;
-int send_key_changed(connection_t *
c, node_t *
n)
+int send_key_changed(connection_t *
c, node_t *
n)
{
cp();
{
cp();
@@
-59,7
+59,7
@@
int send_key_changed(connection_t * c, node_t * n)
return send_request(c, "%d %lx %s", KEY_CHANGED, random(), n->name);
}
return send_request(c, "%d %lx %s", KEY_CHANGED, random(), n->name);
}
-int key_changed_h(connection_t *
c)
+int key_changed_h(connection_t *c)
{
char name[MAX_STRING_SIZE];
node_t *n;
{
char name[MAX_STRING_SIZE];
node_t *n;
@@
-93,14
+93,14
@@
int key_changed_h(connection_t * c)
return 0;
}
return 0;
}
-int send_req_key(connection_t *
c, node_t * from, node_t *
to)
+int send_req_key(connection_t *
c, node_t *from, node_t *
to)
{
cp();
return send_request(c, "%d %s %s", REQ_KEY, from->name, to->name);
}
{
cp();
return send_request(c, "%d %s %s", REQ_KEY, from->name, to->name);
}
-int req_key_h(connection_t *
c)
+int req_key_h(connection_t *c)
{
char from_name[MAX_STRING_SIZE];
char to_name[MAX_STRING_SIZE];
{
char from_name[MAX_STRING_SIZE];
char to_name[MAX_STRING_SIZE];
@@
-143,7
+143,7
@@
int req_key_h(connection_t * c)
return 0;
}
return 0;
}
-int send_ans_key(connection_t *
c, node_t * from, node_t *
to)
+int send_ans_key(connection_t *
c, node_t *from, node_t *
to)
{
char key[MAX_STRING_SIZE];
{
char key[MAX_STRING_SIZE];
@@
-159,7
+159,7
@@
int send_ans_key(connection_t * c, node_t * from, node_t * to)
from->compression);
}
from->compression);
}
-int ans_key_h(connection_t *
c)
+int ans_key_h(connection_t *c)
{
char from_name[MAX_STRING_SIZE];
char to_name[MAX_STRING_SIZE];
{
char from_name[MAX_STRING_SIZE];
char to_name[MAX_STRING_SIZE];
diff --git
a/src/protocol_misc.c
b/src/protocol_misc.c
index
4dcdd92
..
363c8c3
100644
(file)
--- a/
src/protocol_misc.c
+++ b/
src/protocol_misc.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_misc.c,v 1.1.4.
6 2002/09/09 21:25:02
guus Exp $
+ $Id: protocol_misc.c,v 1.1.4.
7 2002/09/09 22:33:04
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-42,7
+42,7
@@
/* Status and error notification routines */
/* Status and error notification routines */
-int send_status(connection_t *
c, int statusno, char *statusstring)
+int send_status(connection_t *c, int statusno, char *statusstring)
{
cp();
{
cp();
@@
-52,7
+52,7
@@
int send_status(connection_t * c, int statusno, char *statusstring)
return send_request(c, "%d %d %s", STATUS, statusno, statusstring);
}
return send_request(c, "%d %d %s", STATUS, statusno, statusstring);
}
-int status_h(connection_t *
c)
+int status_h(connection_t *c)
{
int statusno;
char statusstring[MAX_STRING_SIZE];
{
int statusno;
char statusstring[MAX_STRING_SIZE];
@@
-73,7
+73,7
@@
int status_h(connection_t * c)
return 0;
}
return 0;
}
-int send_error(connection_t *
c, int err, char *errstring)
+int send_error(connection_t *c, int err, char *errstring)
{
cp();
{
cp();
@@
-83,7
+83,7
@@
int send_error(connection_t * c, int err, char *errstring)
return send_request(c, "%d %d %s", ERROR, err, errstring);
}
return send_request(c, "%d %d %s", ERROR, err, errstring);
}
-int error_h(connection_t *
c)
+int error_h(connection_t *c)
{
int err;
char errorstring[MAX_STRING_SIZE];
{
int err;
char errorstring[MAX_STRING_SIZE];
@@
-106,14
+106,14
@@
int error_h(connection_t * c)
return 0;
}
return 0;
}
-int send_termreq(connection_t *
c)
+int send_termreq(connection_t *c)
{
cp();
return send_request(c, "%d", TERMREQ);
}
{
cp();
return send_request(c, "%d", TERMREQ);
}
-int termreq_h(connection_t *
c)
+int termreq_h(connection_t *c)
{
cp();
{
cp();
@@
-122,7
+122,7
@@
int termreq_h(connection_t * c)
return 0;
}
return 0;
}
-int send_ping(connection_t *
c)
+int send_ping(connection_t *c)
{
cp();
{
cp();
@@
-132,21
+132,21
@@
int send_ping(connection_t * c)
return send_request(c, "%d", PING);
}
return send_request(c, "%d", PING);
}
-int ping_h(connection_t *
c)
+int ping_h(connection_t *c)
{
cp();
return send_pong(c);
}
{
cp();
return send_pong(c);
}
-int send_pong(connection_t *
c)
+int send_pong(connection_t *c)
{
cp();
return send_request(c, "%d", PONG);
}
{
cp();
return send_request(c, "%d", PONG);
}
-int pong_h(connection_t *
c)
+int pong_h(connection_t *c)
{
cp();
{
cp();
@@
-162,7
+162,7
@@
int pong_h(connection_t * c)
/* Sending and receiving packets via TCP */
/* Sending and receiving packets via TCP */
-int send_tcppacket(connection_t *
c, vpn_packet_t *
packet)
+int send_tcppacket(connection_t *
c, vpn_packet_t *
packet)
{
int x;
{
int x;
@@
-178,7
+178,7
@@
int send_tcppacket(connection_t * c, vpn_packet_t * packet)
return send_meta(c, packet->data, packet->len);
}
return send_meta(c, packet->data, packet->len);
}
-int tcppacket_h(connection_t *
c)
+int tcppacket_h(connection_t *c)
{
short int len;
{
short int len;
diff --git
a/src/protocol_node.c
b/src/protocol_node.c
index
f6be38f
..
fa04e13
100644
(file)
--- a/
src/protocol_node.c
+++ b/
src/protocol_node.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_node.c,v 1.1.4.
8 2002/09/09 21:25:02
guus Exp $
+ $Id: protocol_node.c,v 1.1.4.
9 2002/09/09 22:33:08
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-43,7
+43,7
@@
#include "system.h"
#include "system.h"
-int send_add_node(connection_t *
c, node_t *
n)
+int send_add_node(connection_t *
c, node_t *
n)
{
int x;
char *address, *port;
{
int x;
char *address, *port;
@@
-60,7
+60,7
@@
int send_add_node(connection_t * c, node_t * n)
return x;
}
return x;
}
-int add_node_h(connection_t *
c)
+int add_node_h(connection_t *c)
{
connection_t *other;
node_t *n, *prevhop, *via;
{
connection_t *other;
node_t *n, *prevhop, *via;
@@
-178,13
+178,13
@@
int add_node_h(connection_t * c)
return 0;
}
return 0;
}
-int send_del_node(connection_t *
c, node_t *
n)
+int send_del_node(connection_t *
c, node_t *
n)
{
cp();
return send_request(c, "%d %s %s", DEL_NODE, n->name, n->prevhop->name);
}
{
cp();
return send_request(c, "%d %s %s", DEL_NODE, n->name, n->prevhop->name);
}
-int del_node_h(connection_t *
c)
+int del_node_h(connection_t *c)
{
char name[MAX_STRING_SIZE];
char prevhopname[MAX_STRING_SIZE];
{
char name[MAX_STRING_SIZE];
char prevhopname[MAX_STRING_SIZE];
diff --git
a/src/protocol_subnet.c
b/src/protocol_subnet.c
index
81cd52c
..
b426a8e
100644
(file)
--- a/
src/protocol_subnet.c
+++ b/
src/protocol_subnet.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_subnet.c,v 1.1.4.
8 2002/09/09 21:25:02
guus Exp $
+ $Id: protocol_subnet.c,v 1.1.4.
9 2002/09/09 22:33:13
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-43,7
+43,7
@@
#include "system.h"
#include "system.h"
-int send_add_subnet(connection_t *
c, subnet_t *
subnet)
+int send_add_subnet(connection_t *
c, subnet_t *
subnet)
{
int x;
char *netstr;
{
int x;
char *netstr;
@@
-58,7
+58,7
@@
int send_add_subnet(connection_t * c, subnet_t * subnet)
return x;
}
return x;
}
-int add_subnet_h(connection_t *
c)
+int add_subnet_h(connection_t *c)
{
char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
{
char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
@@
-133,7
+133,7
@@
int add_subnet_h(connection_t * c)
return 0;
}
return 0;
}
-int send_del_subnet(connection_t *
c, subnet_t *
s)
+int send_del_subnet(connection_t *
c, subnet_t *
s)
{
int x;
char *netstr;
{
int x;
char *netstr;
@@
-149,7
+149,7
@@
int send_del_subnet(connection_t * c, subnet_t * s)
return x;
}
return x;
}
-int del_subnet_h(connection_t *
c)
+int del_subnet_h(connection_t *c)
{
char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
{
char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
diff --git
a/src/raw_socket/device.c
b/src/raw_socket/device.c
index
0f239e0
..
8dd00a2
100644
(file)
--- a/
src/raw_socket/device.c
+++ b/
src/raw_socket/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
2 2002/09/09 21:25:28
guus Exp $
+ $Id: device.c,v 1.1.2.
3 2002/09/09 22:33:31
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-117,7
+117,7
@@
void close_device(void)
read, encrypt and send data that is
available through the ethertap device
*/
read, encrypt and send data that is
available through the ethertap device
*/
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
@@
-138,7
+138,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/route.c
b/src/route.c
index
fa99a7e
..
ff84ee9
100644
(file)
--- a/
src/route.c
+++ b/
src/route.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: route.c,v 1.1.2.4
5 2002/09/09 21:25:07
guus Exp $
+ $Id: route.c,v 1.1.2.4
6 2002/09/09 22:33:16
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-67,7
+67,7
@@
int priorityinheritance = 0;
int macexpire = 600;
subnet_t mymac;
int macexpire = 600;
subnet_t mymac;
-void learn_mac(mac_t *
address)
+void learn_mac(mac_t *address)
{
subnet_t *subnet;
avl_node_t *node;
{
subnet_t *subnet;
avl_node_t *node;
@@
-131,7
+131,7
@@
void age_mac(void)
}
}
}
}
-node_t *route_mac(vpn_packet_t *
packet)
+node_t *route_mac(vpn_packet_t *packet)
{
subnet_t *subnet;
{
subnet_t *subnet;
@@
-139,11
+139,11
@@
node_t *route_mac(vpn_packet_t * packet)
/* Learn source address */
/* Learn source address */
- learn_mac((mac_t *)
(&packet->data[6]));
+ learn_mac((mac_t *)(&packet->data[6]));
/* Lookup destination address */
/* Lookup destination address */
- subnet = lookup_subnet_mac((mac_t *)
(&packet->data[0]));
+ subnet = lookup_subnet_mac((mac_t *)(&packet->data[0]));
if(subnet)
return subnet->owner;
if(subnet)
return subnet->owner;
@@
-151,7
+151,7
@@
node_t *route_mac(vpn_packet_t * packet)
return NULL;
}
return NULL;
}
-node_t *route_ipv4(vpn_packet_t *
packet)
+node_t *route_ipv4(vpn_packet_t *packet)
{
subnet_t *subnet;
{
subnet_t *subnet;
@@
-175,7
+175,7
@@
node_t *route_ipv4(vpn_packet_t * packet)
return subnet->owner;
}
return subnet->owner;
}
-node_t *route_ipv6(vpn_packet_t *
packet)
+node_t *route_ipv6(vpn_packet_t *packet)
{
subnet_t *subnet;
{
subnet_t *subnet;
@@
-202,7
+202,7
@@
node_t *route_ipv6(vpn_packet_t * packet)
return subnet->owner;
}
return subnet->owner;
}
-uint16_t inet_checksum(uint16_t *
data, int len, uint16_t prevsum)
+uint16_t inet_checksum(uint16_t *data, int len, uint16_t prevsum)
{
uint32_t checksum = prevsum ^ 0xFFFF;
{
uint32_t checksum = prevsum ^ 0xFFFF;
@@
-215,7
+215,7
@@
uint16_t inet_checksum(uint16_t * data, int len, uint16_t prevsum)
return checksum ^ 0xFFFF;
}
return checksum ^ 0xFFFF;
}
-void route_neighborsol(vpn_packet_t *
packet)
+void route_neighborsol(vpn_packet_t *packet)
{
struct ip6_hdr *hdr;
struct nd_neighbor_solicit *ns;
{
struct ip6_hdr *hdr;
struct nd_neighbor_solicit *ns;
@@
-232,9
+232,9
@@
void route_neighborsol(vpn_packet_t * packet)
cp();
cp();
- hdr = (struct ip6_hdr *)
(packet->data + 14);
- ns = (struct nd_neighbor_solicit *)
(packet->data + 14 + sizeof(*hdr));
- opt = (struct nd_opt_hdr *)
(packet->data + 14 + sizeof(*hdr) + sizeof(*ns));
+ hdr = (struct ip6_hdr *)(packet->data + 14);
+ ns = (struct nd_neighbor_solicit *)(packet->data + 14 + sizeof(*hdr));
+ opt = (struct nd_opt_hdr *)(packet->data + 14 + sizeof(*hdr) + sizeof(*ns));
/* First, snatch the source address from the neighbor solicitation packet */
/* First, snatch the source address from the neighbor solicitation packet */
@@
-330,7
+330,7
@@
void route_neighborsol(vpn_packet_t * packet)
write_packet(packet);
}
write_packet(packet);
}
-void route_arp(vpn_packet_t *
packet)
+void route_arp(vpn_packet_t *packet)
{
struct ether_arp *arp;
subnet_t *subnet;
{
struct ether_arp *arp;
subnet_t *subnet;
@@
-347,7
+347,7
@@
void route_arp(vpn_packet_t * packet)
Most of the code here is taken from choparp.c by Takamichi Tateoka (tree@mma.club.uec.ac.jp)
*/
Most of the code here is taken from choparp.c by Takamichi Tateoka (tree@mma.club.uec.ac.jp)
*/
- arp = (struct ether_arp *)
(packet->data + 14);
+ arp = (struct ether_arp *)(packet->data + 14);
/* Check if this is a valid ARP request */
/* Check if this is a valid ARP request */
@@
-392,7
+392,7
@@
void route_arp(vpn_packet_t * packet)
write_packet(packet);
}
write_packet(packet);
}
-void route_outgoing(vpn_packet_t *
packet)
+void route_outgoing(vpn_packet_t *packet)
{
uint16_t type;
node_t *n = NULL;
{
uint16_t type;
node_t *n = NULL;
@@
-403,7
+403,7
@@
void route_outgoing(vpn_packet_t * packet)
switch (routing_mode) {
case RMODE_ROUTER:
switch (routing_mode) {
case RMODE_ROUTER:
- type = ntohs(*((uint16_t *)
(&packet->data[12])));
+ type = ntohs(*((uint16_t *)(&packet->data[12])));
switch (type) {
case 0x0800:
n = route_ipv4(packet);
switch (type) {
case 0x0800:
n = route_ipv4(packet);
@@
-444,7
+444,7
@@
void route_outgoing(vpn_packet_t * packet)
}
}
}
}
-void route_incoming(node_t *
source, vpn_packet_t *
packet)
+void route_incoming(node_t *
source, vpn_packet_t *
packet)
{
switch (routing_mode) {
case RMODE_ROUTER:
{
switch (routing_mode) {
case RMODE_ROUTER:
@@
-452,7
+452,7
@@
void route_incoming(node_t * source, vpn_packet_t * packet)
node_t *n = NULL;
uint16_t type;
node_t *n = NULL;
uint16_t type;
- type = ntohs(*((uint16_t *)
(&packet->data[12])));
+ type = ntohs(*((uint16_t *)(&packet->data[12])));
switch (type) {
case 0x0800:
n = route_ipv4(packet);
switch (type) {
case 0x0800:
n = route_ipv4(packet);
@@
-481,7
+481,7
@@
void route_incoming(node_t * source, vpn_packet_t * packet)
{
subnet_t *subnet;
{
subnet_t *subnet;
- subnet = lookup_subnet_mac((mac_t *)
(&packet->data[0]));
+ subnet = lookup_subnet_mac((mac_t *)(&packet->data[0]));
if(subnet) {
if(subnet->owner == myself)
if(subnet) {
if(subnet->owner == myself)
diff --git
a/src/solaris/device.c
b/src/solaris/device.c
index
bab7236
..
47bfa60
100644
(file)
--- a/
src/solaris/device.c
+++ b/
src/solaris/device.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.
9 2002/09/09 21:25:28
guus Exp $
+ $Id: device.c,v 1.1.2.
10 2002/09/09 22:33:31
guus Exp $
*/
*/
@@
-136,7
+136,7
@@
void close_device(void)
cp close(device_fd);
}
cp close(device_fd);
}
-int read_packet(vpn_packet_t *
packet)
+int read_packet(vpn_packet_t *packet)
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
{
int lenin;
cp if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
@@
-162,7
+162,7
@@
int read_packet(vpn_packet_t * packet)
return 0;
cp}
return 0;
cp}
-int write_packet(vpn_packet_t *
packet)
+int write_packet(vpn_packet_t *packet)
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
{
cp if(debug_lvl >= DEBUG_TRAFFIC)
syslog(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
diff --git
a/src/subnet.c
b/src/subnet.c
index
4ceec9a
..
fa00cd8
100644
(file)
--- a/
src/subnet.c
+++ b/
src/subnet.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: subnet.c,v 1.1.2.4
1 2002/09/09 21:25:10
guus Exp $
+ $Id: subnet.c,v 1.1.2.4
2 2002/09/09 22:33:21
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-48,7
+48,7
@@
avl_tree_t *subnet_tree;
/* Subnet comparison */
/* Subnet comparison */
-int subnet_compare_mac(subnet_t *
a, subnet_t *
b)
+int subnet_compare_mac(subnet_t *
a, subnet_t *
b)
{
int result;
{
int result;
@@
-60,7
+60,7
@@
int subnet_compare_mac(subnet_t * a, subnet_t * b)
return strcmp(a->owner->name, b->owner->name);
}
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare_ipv4(subnet_t *
a, subnet_t *
b)
+int subnet_compare_ipv4(subnet_t *
a, subnet_t *
b)
{
int result;
{
int result;
@@
-77,7
+77,7
@@
int subnet_compare_ipv4(subnet_t * a, subnet_t * b)
return strcmp(a->owner->name, b->owner->name);
}
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare_ipv6(subnet_t *
a, subnet_t *
b)
+int subnet_compare_ipv6(subnet_t *
a, subnet_t *
b)
{
int result;
{
int result;
@@
-94,7
+94,7
@@
int subnet_compare_ipv6(subnet_t * a, subnet_t * b)
return strcmp(a->owner->name, b->owner->name);
}
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare(subnet_t *
a, subnet_t *
b)
+int subnet_compare(subnet_t *
a, subnet_t *
b)
{
int result;
{
int result;
@@
-145,7
+145,7
@@
avl_tree_t *new_subnet_tree(void)
return avl_alloc_tree((avl_compare_t) subnet_compare, NULL);
}
return avl_alloc_tree((avl_compare_t) subnet_compare, NULL);
}
-void free_subnet_tree(avl_tree_t *
subnet_tree)
+void free_subnet_tree(avl_tree_t *subnet_tree)
{
cp();
{
cp();
@@
-161,7
+161,7
@@
subnet_t *new_subnet(void)
return (subnet_t *) xmalloc_and_zero(sizeof(subnet_t));
}
return (subnet_t *) xmalloc_and_zero(sizeof(subnet_t));
}
-void free_subnet(subnet_t *
subnet)
+void free_subnet(subnet_t *subnet)
{
cp();
{
cp();
@@
-170,7
+170,7
@@
void free_subnet(subnet_t * subnet)
/* Adding and removing subnets */
/* Adding and removing subnets */
-void subnet_add(node_t *
n, subnet_t *
subnet)
+void subnet_add(node_t *
n, subnet_t *
subnet)
{
cp();
{
cp();
@@
-180,7
+180,7
@@
void subnet_add(node_t * n, subnet_t * subnet)
avl_insert(n->subnet_tree, subnet);
}
avl_insert(n->subnet_tree, subnet);
}
-void subnet_del(node_t *
n, subnet_t *
subnet)
+void subnet_del(node_t *
n, subnet_t *
subnet)
{
cp();
{
cp();
@@
-259,7
+259,7
@@
subnet_t *str2net(char *subnetstr)
return NULL;
}
return NULL;
}
-char *net2str(subnet_t *
subnet)
+char *net2str(subnet_t *subnet)
{
char *netstr;
{
char *netstr;
@@
-309,14
+309,14
@@
char *net2str(subnet_t * subnet)
/* Subnet lookup routines */
/* Subnet lookup routines */
-subnet_t *lookup_subnet(node_t *
owner, subnet_t *
subnet)
+subnet_t *lookup_subnet(node_t *
owner, subnet_t *
subnet)
{
cp();
return avl_search(owner->subnet_tree, subnet);
}
{
cp();
return avl_search(owner->subnet_tree, subnet);
}
-subnet_t *lookup_subnet_mac(mac_t *
address)
+subnet_t *lookup_subnet_mac(mac_t *address)
{
subnet_t subnet, *p;
{
subnet_t subnet, *p;
@@
-331,7
+331,7
@@
subnet_t *lookup_subnet_mac(mac_t * address)
return p;
}
return p;
}
-subnet_t *lookup_subnet_ipv4(ipv4_t *
address)
+subnet_t *lookup_subnet_ipv4(ipv4_t *address)
{
subnet_t subnet, *p;
{
subnet_t subnet, *p;
@@
-369,7
+369,7
@@
subnet_t *lookup_subnet_ipv4(ipv4_t * address)
return p;
}
return p;
}
-subnet_t *lookup_subnet_ipv6(ipv6_t *
address)
+subnet_t *lookup_subnet_ipv6(ipv6_t *address)
{
subnet_t subnet, *p;
{
subnet_t subnet, *p;