summaryrefslogtreecommitdiffstats
path: root/src/fixedmap.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-10-13 13:40:25 +1100
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-10-13 13:40:25 +1100
commit048fdd8509ca7b10fad09e9aa877f7bb5c9565a6 (patch)
tree261a2123fd04e9b5e8ca8d36b4b64c0809666556 /src/fixedmap.h
parentUpdate wireguard.c includes (diff)
downloadwireguard-openbsd-048fdd8509ca7b10fad09e9aa877f7bb5c9565a6.tar.xz
wireguard-openbsd-048fdd8509ca7b10fad09e9aa877f7bb5c9565a6.zip
Move all relevant functions to if_wg.c
Diffstat (limited to 'src/fixedmap.h')
-rw-r--r--src/fixedmap.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/fixedmap.h b/src/fixedmap.h
deleted file mode 100644
index a7dc0216223..00000000000
--- a/src/fixedmap.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2019 Matt Dunwoodie <ncon@noconroy.net>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __FIXEDMAP_H__
-#define __FIXEDMAP_H__
-
-#include <sys/types.h>
-#include <sys/mutex.h>
-
-#define FM_FOREACH(item, fm) \
- for (item = (fm)->map; item < (fm)->map + (fm)->size; item++)
-#define FM_FOREACH_FILLED(item, fm) \
- FM_FOREACH(item, fm) if (item->state == FM_ITEM_FILLED)
-#define FM_FOREACH_EMPTY(item, fm) \
- FM_FOREACH(item, fm) if (item->state == FM_ITEM_EMPTY)
-
-struct fixed_map {
- size_t size;
- struct mutex mtx;
- struct map_item {
- enum {
- FM_ITEM_EMPTY = 0,
- FM_ITEM_FILLED,
- } state;
- uint32_t key;
- struct refcnt refcnt;
- void *value;
- } *map;
-};
-
-void fm_init(struct fixed_map *, size_t, int);
-void fm_destroy(struct fixed_map *);
-void fm_resize(struct fixed_map *, size_t);
-uint32_t fm_insert(struct fixed_map *, void *);
-void *fm_lookup(struct fixed_map *, uint32_t);
-void fm_put(struct fixed_map *, uint32_t);
-void fm_drop(struct fixed_map *, uint32_t);
-
-#endif /* __FIXEDMAP_H__ */