struct zebra_ptm_cb ptm_cb;
static int zebra_ptm_socket_init(void);
-int zebra_ptm_sock_read(struct thread *);
+void zebra_ptm_sock_read(struct thread *thread);
static void zebra_ptm_install_commands(void);
static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt);
void zebra_bfd_peer_replay_req(void);
close(ptm_cb.ptm_sock);
}
-static int zebra_ptm_flush_messages(struct thread *thread)
+static void zebra_ptm_flush_messages(struct thread *thread)
{
ptm_cb.t_write = NULL;
if (ptm_cb.ptm_sock == -1)
- return -1;
+ return;
errno = 0;
ptm_cb.t_timer = NULL;
thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
ptm_cb.reconnect_time, &ptm_cb.t_timer);
- return -1;
+ return;
case BUFFER_PENDING:
ptm_cb.t_write = NULL;
thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
case BUFFER_EMPTY:
break;
}
-
- return 0;
}
static int zebra_ptm_send_message(char *data, int size)
return 0;
}
-int zebra_ptm_connect(struct thread *t)
+void zebra_ptm_connect(struct thread *t)
{
int init = 0;
} else if (ptm_cb.reconnect_time >= ZEBRA_PTM_RECONNECT_TIME_MAX) {
ptm_cb.reconnect_time = ZEBRA_PTM_RECONNECT_TIME_INITIAL;
}
-
- return (errno);
}
DEFUN (zebra_ptm_enable,
}
}
-int zebra_ptm_sock_read(struct thread *thread)
+void zebra_ptm_sock_read(struct thread *thread)
{
int sock;
int rc;
sock = THREAD_FD(thread);
if (sock == -1)
- return -1;
+ return;
/* PTM communicates in CSV format */
do {
thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
ptm_cb.reconnect_time,
&ptm_cb.t_timer);
- return -1;
+ return;
}
ptm_cb.t_read = NULL;
thread_add_read(zrouter.master, zebra_ptm_sock_read, NULL,
ptm_cb.ptm_sock, &ptm_cb.t_read);
-
- return 0;
}
/* BFD peer/dst register/update */
}
/*
- * The message type will be BFD_DEST_REPLY so we can use only
+ * The message type will be ZEBRA_BFD_DEST_REPLAY so we can use only
* one callback at the `bfdd` side, however the real command
* number will be included right after the zebra header.
*/