2 ;;; zebra-mode.el -- major mode for editing zebra configuration file.
4 ;; Copyright (C) 1998 Kunihiro Ishiguro
6 ;; Author: 1998 Kunihiro Ishiguro
8 ;; Maintainer: kunihiro@zebra.org
9 ;; seirios@Matrix.IRI.Co.JP
10 ;; Created: Jan 28 1998
12 ;; Keywords: zebra bgpd ripd ripngd languages
14 ;; You can get the latest version of zebra from
16 ;; http://www.zebra.org/
18 ;; Install this Emacs Lisp code
21 ;; % $(EMACS) -batch -f batch-byte-compile zebra.el
22 ;; Install zebra.el,zebra.elc to Emacs-load-path
23 ;; % cp zebra.el zebra.elc $(emacs-load-path)
24 ;; Add .emacs or (site-load.el | site-start.el)
25 ;; (auto-load 'zebra-mode "zebra" nil t)
26 ;; (auto-load 'bgp-mode "zebra" nil t)
27 ;; (auto-load 'rip-mode "zebra" nil t)
34 (defvar zebra-font-lock-keywords
36 '("#.*$" . font-lock-comment-face)
37 '("!.*$" . font-lock-comment-face)
38 '("no\\|interface" . font-lock-type-face)
39 '("ip6\\|ip\\|route\\|address" . font-lock-function-name-face)
40 '("ipforward\\|ipv6forward" . font-lock-keyword-face)
41 '("hostname\\|password\\|enable\\|logfile\\|no" . font-lock-keyword-face))
42 "Default value to highlight in zebra mode.")
44 (defvar bgp-font-lock-keywords
46 '("#.*$" . font-lock-comment-face)
47 '("!.*$" . font-lock-comment-face)
48 '("no\\|router" . font-lock-type-face)
49 '("bgp\\|router-id\\|neighbor\\|network" . font-lock-function-name-face)
50 '("ebgp\\|multihop\\|next\\|zebra\\|remote-as" . font-lock-keyword-face)
51 '("hostname\\|password\\|enable\\|logfile\\|no" . font-lock-keyword-face))
52 "Default value to highlight in bgp mode.")
54 (defvar rip-font-lock-keywords
56 '("#.*$" . font-lock-comment-face)
57 '("!.*$" . font-lock-comment-face)
58 '("no\\|router\\|interface\\|ipv6\\|ip6\\|ip" . font-lock-type-face)
59 '("ripng\\|rip\\|recive\\|advertize\\|accept" . font-lock-function-name-face)
60 '("version\\|network" . font-lock-function-name-face)
61 '("default\\|none\\|zebra" . font-lock-keyword-face)
62 '("hostname\\|password\\|enable\\|logfile\\|no" . font-lock-keyword-face))
63 "Default value to highlight in bgp mode.")
67 (defun zebra-font-lock ()
68 (make-local-variable 'font-lock-defaults)
69 (setq font-lock-defaults '(zebra-font-lock-keywords nil t)))
71 (defun bgp-font-lock ()
72 (make-local-variable 'font-lock-defaults)
73 (setq font-lock-defaults '(bgp-font-lock-keywords nil t)))
75 (defun rip-font-lock ()
76 (make-local-variable 'font-lock-defaults)
77 (setq font-lock-defaults '(rip-font-lock-keywords nil t)))
81 (defun major-mode-define ()
84 (setq comment-start "[#!]"
86 comment-start-skip "!+ ")
87 (run-hooks 'zebra-mode-hook)
89 ((string< "20" emacs-version)
94 (setq mode-name "zebra")
100 (setq mode-name "bgp")
106 (setq mode-name "rip")