]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_fsm.h
*: make consistent & update GPLv2 file headers
[mirror_frr.git] / bgpd / bgp_fsm.h
index 4d0b48f5296e8f47c6788e4a0e4dc0ae88ccd9ee..33cba868ee30cf7c254db34f3732eb7dd3bf2c32 100644 (file)
@@ -1,80 +1,80 @@
 /* BGP-4 Finite State Machine   
  From RFC1771 [A Border Gateway Protocol 4 (BGP-4)]
  Copyright (C) 1998 Kunihiro Ishiguro
-
-This file is part of GNU Zebra.
-
-GNU Zebra is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-GNU Zebra is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Zebra; see the file COPYING.  If not, write to the Free
-Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
* From RFC1771 [A Border Gateway Protocol 4 (BGP-4)]
* Copyright (C) 1998 Kunihiro Ishiguro
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
 
 #ifndef _QUAGGA_BGP_FSM_H
 #define _QUAGGA_BGP_FSM_H
 
 /* Macro for BGP read, write and timer thread.  */
-#define BGP_READ_ON(T,F,V)                     \
-  do {                                         \
-    if (!(T) && (peer->status != Deleted))     \
-      THREAD_READ_ON(bm->master,T,F,peer,V);   \
+#define BGP_READ_ON(T,F,V) \
+  do { \
+    if ((peer->status != Deleted)) \
+      thread_add_read (bm->master,(F),peer,(V),&(T)); \
   } while (0)
 
-#define BGP_READ_OFF(T)                                \
-  do {                                         \
-    if (T)                                     \
-      THREAD_READ_OFF(T);                      \
+#define BGP_READ_OFF(T) \
+  do { \
+    if (T) \
+      THREAD_READ_OFF(T); \
   } while (0)
 
-#define BGP_WRITE_ON(T,F,V)                    \
-  do {                                         \
-    if (!(T) && (peer->status != Deleted))     \
-      THREAD_WRITE_ON(bm->master,(T),(F),peer,(V)); \
+#define BGP_WRITE_ON(T,F,V) \
+  do { \
+    if ((peer)->status != Deleted) \
+      thread_add_write (bm->master,(F),(peer),(V),&(T)); \
   } while (0)
 
-#define BGP_PEER_WRITE_ON(T,F,V, peer)                 \
-  do {                                                 \
-    if (!(T) && ((peer)->status != Deleted))           \
-      THREAD_WRITE_ON(bm->master,(T),(F),(peer),(V));  \
+#define BGP_PEER_WRITE_ON(T,F,V, peer) \
+  do { \
+    if ((peer)->status != Deleted) \
+      thread_add_write (bm->master,(F),(peer),(V),&(T)); \
   } while (0)
 
-#define BGP_WRITE_OFF(T)                       \
-  do {                                         \
-    if (T)                                     \
-      THREAD_WRITE_OFF(T);                     \
+#define BGP_WRITE_OFF(T) \
+  do { \
+    if (T) \
+      THREAD_WRITE_OFF(T); \
   } while (0)
 
-#define BGP_TIMER_ON(T,F,V)                    \
-  do {                                         \
-    if (!(T) && (peer->status != Deleted))     \
-      THREAD_TIMER_ON(bm->master,(T),(F),peer,(V)); \
+#define BGP_TIMER_ON(T,F,V) \
+  do { \
+    if ((peer->status != Deleted)) \
+      thread_add_timer (bm->master,(F),peer,(V),&(T)); \
   } while (0)
 
-#define BGP_TIMER_OFF(T)                       \
-  do {                                         \
-    if (T)                                     \
-      THREAD_TIMER_OFF(T);                     \
+#define BGP_TIMER_OFF(T) \
+  do { \
+    if (T) \
+      THREAD_TIMER_OFF(T); \
   } while (0)
 
-#define BGP_EVENT_ADD(P,E)                     \
-  do {                                         \
-    if ((P)->status != Deleted)                        \
-      thread_add_event (bm->master, bgp_event, (P), (E)); \
+#define BGP_EVENT_ADD(P,E) \
+  do { \
+    if ((P)->status != Deleted) \
+      thread_add_event (bm->master, bgp_event, (P), (E), NULL); \
   } while (0)
 
-#define BGP_EVENT_FLUSH(P)                     \
-  do {                                                 \
-    assert (peer);                             \
-    thread_cancel_event (bm->master, (P));             \
+#define BGP_EVENT_FLUSH(P) \
+  do { \
+    assert (peer); \
+    thread_cancel_event (bm->master, (P)); \
   } while (0)
 
 #define BGP_MSEC_JITTER 10