summaryrefslogtreecommitdiff
path: root/src/bgpstore.lisp
blob: ba448eea4839704a411c6e1c35fdcc7025b4e3cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-

(defparameter *db-spec* '("bgpstore" "bgpstore" "bgpstore" "localhost" ))

(defun start-bgpstore (host port)
  (with-connection *db-spec* 
    (let ((reader (new-reader host port))
	  (count 0))
      (do ((e (next-xml-blurb reader "BGP_MESSAGE")
	      (next-xml-blurb reader "BGP_MESSAGE")))
	  ((null e))
	(dolist (obj (new-entries (xml-top-elem-from-octets e)))
	  (insert-dao obj)
	  (incf count)
	  (if (mod count 100) (format t ".")
	      (if (mod count 1000) (format t "+")
		  (if (mod count 10000)
		      (format t "~%~A ~A "
			      (iso-date (get-universal-time) t)
			      count))))
      (close-reader))))

(defun stop-bgpstore ())