summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-12-25 10:26:52 -0500
committerDonald Sharp <sharpd@nvidia.com>2023-03-24 08:32:17 -0400
commite16d030c65ca97b1ba68b93ada93b1d4edde59d3 (patch)
treee3a57a2e2887a899cad71c0640047b2b2409b5fa /lib/vty.c
parent70d4d90c82f3fb4eb552438422afb79e29a4dca0 (diff)
*: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/vty.c b/lib/vty.c
index e26237e554..e2130e5d67 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1366,7 +1366,7 @@ static void vty_read(struct event *thread)
int nbytes;
unsigned char buf[VTY_READ_BUFSIZ];
- struct vty *vty = THREAD_ARG(thread);
+ struct vty *vty = EVENT_ARG(thread);
/* Read raw data from socket */
if ((nbytes = read(vty->fd, buf, VTY_READ_BUFSIZ)) <= 0) {
@@ -1567,11 +1567,11 @@ static void vty_flush(struct event *thread)
{
int erase;
buffer_status_t flushrc;
- struct vty *vty = THREAD_ARG(thread);
+ struct vty *vty = EVENT_ARG(thread);
/* Tempolary disable read thread. */
if (vty->lines == 0)
- THREAD_OFF(vty->t_read);
+ EVENT_OFF(vty->t_read);
/* Function execution continue. */
erase = ((vty->status == VTY_MORE || vty->status == VTY_MORELINE));
@@ -1757,9 +1757,9 @@ void vty_stdio_suspend(void)
if (!stdio_vty)
return;
- THREAD_OFF(stdio_vty->t_write);
- THREAD_OFF(stdio_vty->t_read);
- THREAD_OFF(stdio_vty->t_timeout);
+ EVENT_OFF(stdio_vty->t_write);
+ EVENT_OFF(stdio_vty->t_read);
+ EVENT_OFF(stdio_vty->t_timeout);
if (stdio_termios)
tcsetattr(0, TCSANOW, &stdio_orig_termios);
@@ -1825,7 +1825,7 @@ struct vty *vty_stdio(void (*atclose)(int isexit))
/* Accept connection from the network. */
static void vty_accept(struct event *thread)
{
- struct vty_serv *vtyserv = THREAD_ARG(thread);
+ struct vty_serv *vtyserv = EVENT_ARG(thread);
int vty_sock;
union sockunion su;
int ret;
@@ -2038,7 +2038,7 @@ static void vty_serv_un(const char *path)
static void vtysh_accept(struct event *thread)
{
- struct vty_serv *vtyserv = THREAD_ARG(thread);
+ struct vty_serv *vtyserv = EVENT_ARG(thread);
int accept_sock = vtyserv->sock;
int sock;
int client_len;
@@ -2176,8 +2176,8 @@ static void vtysh_read(struct event *thread)
unsigned char *p;
uint8_t header[4] = {0, 0, 0, 0};
- sock = THREAD_FD(thread);
- vty = THREAD_ARG(thread);
+ sock = EVENT_FD(thread);
+ vty = EVENT_ARG(thread);
if ((nbytes = read(sock, buf, VTY_READ_BUFSIZ)) <= 0) {
if (nbytes < 0) {
@@ -2277,7 +2277,7 @@ static void vtysh_read(struct event *thread)
static void vtysh_write(struct event *thread)
{
- struct vty *vty = THREAD_ARG(thread);
+ struct vty *vty = EVENT_ARG(thread);
vtysh_flush(vty);
}
@@ -2322,9 +2322,9 @@ void vty_close(struct vty *vty)
vty_config_exit(vty);
/* Cancel threads.*/
- THREAD_OFF(vty->t_read);
- THREAD_OFF(vty->t_write);
- THREAD_OFF(vty->t_timeout);
+ EVENT_OFF(vty->t_read);
+ EVENT_OFF(vty->t_write);
+ EVENT_OFF(vty->t_timeout);
if (vty->pass_fd != -1) {
close(vty->pass_fd);
@@ -2386,7 +2386,7 @@ static void vty_timeout(struct event *thread)
{
struct vty *vty;
- vty = THREAD_ARG(thread);
+ vty = EVENT_ARG(thread);
vty->v_timeout = 0;
/* Clear buffer*/
@@ -2844,7 +2844,7 @@ static void vty_event(enum vty_event event, struct vty *vty)
/* Time out treatment. */
if (vty->v_timeout) {
- THREAD_OFF(vty->t_timeout);
+ EVENT_OFF(vty->t_timeout);
event_add_timer(vty_master, vty_timeout, vty,
vty->v_timeout, &vty->t_timeout);
}
@@ -2854,7 +2854,7 @@ static void vty_event(enum vty_event event, struct vty *vty)
&vty->t_write);
break;
case VTY_TIMEOUT_RESET:
- THREAD_OFF(vty->t_timeout);
+ EVENT_OFF(vty->t_timeout);
if (vty->v_timeout)
event_add_timer(vty_master, vty_timeout, vty,
vty->v_timeout, &vty->t_timeout);
@@ -3726,7 +3726,7 @@ void vty_terminate(void)
vtys_init(vtysh_sessions);
while ((vtyserv = vtyservs_pop(vty_servs))) {
- THREAD_OFF(vtyserv->t_accept);
+ EVENT_OFF(vtyserv->t_accept);
close(vtyserv->sock);
XFREE(MTYPE_VTY_SERV, vtyserv);
}