summaryrefslogtreecommitdiffstats
path: root/babeld/source.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-13 20:59:41 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-05-13 20:59:41 +0200
commitca10883edca52ceffddbeb4d7a812f3de9c1f664 (patch)
treea887f2f66e0d133d05432b17e5915d7e27f39f3a /babeld/source.h
parentMerge pull request #525 from qlyoung/frr-script-fix (diff)
downloadfrr-ca10883edca52ceffddbeb4d7a812f3de9c1f664.tar.xz
frr-ca10883edca52ceffddbeb4d7a812f3de9c1f664.zip
*: Initial Import of Babeld into FRR
This is a direct copy of: https://github.com/boutier/quagga-merge From the branch babel-merge I copied the babeld directory into FRR and then fixed up everything to compile. Babeld at this point in time when run will more than likely crash and burn in it's interfactions with zebra. I might have messed up the cli, which will need to be looked at extract.pl.in and vtysh.c need to be fixed up. Additionally we probably need to work on DEFUN_NOSH conversion in babeld as well This code comes from: Matthieu Boutier <boutier@irif.fr> Juliusz Chroboczek <jch@irif.fr> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'babeld/source.h')
-rw-r--r--babeld/source.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/babeld/source.h b/babeld/source.h
new file mode 100644
index 000000000..5b0ba44aa
--- /dev/null
+++ b/babeld/source.h
@@ -0,0 +1,51 @@
+/*
+Copyright (c) 2007, 2008 by Juliusz Chroboczek
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#ifndef BABEL_SOURCE_H
+#define BABEL_SOURCE_H
+
+#define SOURCE_GC_TIME 200
+
+struct source {
+ struct source *next;
+ unsigned char id[8];
+ unsigned char prefix[16];
+ unsigned char plen;
+ unsigned short seqno;
+ unsigned short metric;
+ unsigned short route_count;
+ time_t time;
+};
+
+struct source *find_source(const unsigned char *id,
+ const unsigned char *p,
+ unsigned char plen,
+ int create, unsigned short seqno);
+struct source *retain_source(struct source *src);
+void release_source(struct source *src);
+int flush_source(struct source *src);
+void update_source(struct source *src,
+ unsigned short seqno, unsigned short metric);
+void expire_sources(void);
+void check_sources_released(void);
+
+#endif