summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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