summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2009-06-26 10:23:53 +0200
committerLinus Nordberg <linus@nordberg.se>2009-06-26 10:23:53 +0200
commit1c9302e751d8835206d4d9b5f8afe70d1ca20f92 (patch)
treecc35a7355a091d7e5e794dd7029551bac9b67d9b
parent837dcbb8a3e5d9424ab14dfdea04759f127635c9 (diff)
* src/data.lisp (new-entries): Store nexthop.
-rw-r--r--bgp-logger.org6
-rw-r--r--src/data.lisp10
2 files changed, 13 insertions, 3 deletions
diff --git a/bgp-logger.org b/bgp-logger.org
index 733c8bb..ba0856d 100644
--- a/bgp-logger.org
+++ b/bgp-logger.org
@@ -28,12 +28,14 @@ so now it does.
- [X] store timestamp and precision-time
- [X] store as-path
- [X] move to victoria
-- [ ] store nexthop
+- [X] store nexthop
+- [ ] store octets as binary, in separate table
- [ ] limit access to bgpmon stream (acl's)
-- [ ] auto-start on boot
- [ ] get an idea of disk footprint
- [ ] get an idea of RAM footprint
- [ ] get an idea of CPU load, sbcl and postgres
+- [ ] auto-start on boot
+- [ ] reconnect
- [ ] store bgp-octets as binary
* Running postgresql
diff --git a/src/data.lisp b/src/data.lisp
index 43fea10..b612851 100644
--- a/src/data.lisp
+++ b/src/data.lisp
@@ -93,7 +93,7 @@ TOP-ELEM is an XML document element."
;; AS-PATH --> template. Note that we want AS_PATH->AS
;; only, to avoid getting COMMUNITY->AS.
(setf (path templ)
- (let* ((as-paths (dom:get-elements-by-tag-name update
+ (let ((as-paths (dom:get-elements-by-tag-name update
"AS_PATH")))
(if (= 0 (length as-paths))
"{}"
@@ -108,6 +108,14 @@ TOP-ELEM is an XML document element."
(subseq str 0 (- (length str) 1))
"}")))))
+ ;; NEXT_HOP --> template.
+ (setf (nexthop templ)
+ (let ((nexthops (dom:get-elements-by-tag-name
+ update "NEXT_HOP")))
+ (if (= 0 (length nexthops))
+ "0.0.0.0"
+ (dom:data (aref (dom:child-nodes (aref nexthops 0)) 0)))))
+
;; OCTETS --> template.
(when (> (length octet-msgs) 0)
(let* ((oct (aref (dom:get-elements-by-tag-name