diff options
author | Michele Marchetto <michele@cvs.openbsd.org> | 2009-06-13 16:47:33 +0000 |
---|---|---|
committer | Michele Marchetto <michele@cvs.openbsd.org> | 2009-06-13 16:47:33 +0000 |
commit | 660ca2c631090cc73a0c1dffa1c751585388e02e (patch) | |
tree | 47127db054f508b02fa8a00bb4c219f556586ca6 /usr.sbin | |
parent | e80071386cf16b308c7c8804c91d8ec2fc48c16e (diff) |
Make ldpctl imsg-in-a-lib ready too.
ok eric@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldpctl/ldpctl.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c index 41613f0ceb5..49cd275c6d0 100644 --- a/usr.sbin/ldpctl/ldpctl.c +++ b/usr.sbin/ldpctl/ldpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpctl.c,v 1.1 2009/06/01 20:59:45 michele Exp $ +/* $OpenBSD: ldpctl.c,v 1.2 2009/06/13 16:47:32 michele Exp $ * * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -63,12 +63,6 @@ usage(void) exit(1); } -/* dummy function to allow ldpctl to run without libevent */ -void -imsg_event_add(struct imsgbuf *i) -{ -} - int main(int argc, char *argv[]) { @@ -96,7 +90,7 @@ main(int argc, char *argv[]) if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); - imsg_init(ibuf, ctl_sock, NULL); + imsg_init(ibuf, ctl_sock); done = 0; /* process user request */ @@ -114,51 +108,51 @@ main(int argc, char *argv[]) if (ifidx == 0) errx(1, "no such interface %s", res->ifname); } - imsg_compose(ibuf, IMSG_CTL_SHOW_INTERFACE, 0, 0, + imsg_compose(ibuf, IMSG_CTL_SHOW_INTERFACE, 0, 0, -1, &ifidx, sizeof(ifidx)); break; case SHOW_NBR: printf("%-15s %-15s %-15s %-9s %-10s\n", "ID", "State", "Address", "Iface", "Uptime"); - imsg_compose(ibuf, IMSG_CTL_SHOW_NBR, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0); break; case SHOW_LIB: printf("%-20s %-17s %-17s %s\n", "Destination", "Nexthop", "Local Label", "Remote Label"); - imsg_compose(ibuf, IMSG_CTL_SHOW_LIB, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_SHOW_LIB, 0, 0, -1, NULL, 0); break; case SHOW_LFIB: if (!res->addr.s_addr) - imsg_compose(ibuf, IMSG_CTL_KROUTE, 0, 0, + imsg_compose(ibuf, IMSG_CTL_KROUTE, 0, 0, -1, &res->flags, sizeof(res->flags)); else - imsg_compose(ibuf, IMSG_CTL_KROUTE_ADDR, 0, 0, + imsg_compose(ibuf, IMSG_CTL_KROUTE_ADDR, 0, 0, -1, &res->addr, sizeof(res->addr)); show_lfib_head(); break; case SHOW_LFIB_IFACE: if (*res->ifname) - imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, + imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, -1, res->ifname, sizeof(res->ifname)); else - imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, -1, NULL, 0); show_interface_head(); break; case LFIB: errx(1, "lfib couple|decouple"); break; case LFIB_COUPLE: - imsg_compose(ibuf, IMSG_CTL_LFIB_COUPLE, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_LFIB_COUPLE, 0, 0, -1, NULL, 0); printf("couple request sent.\n"); done = 1; break; case LFIB_DECOUPLE: - imsg_compose(ibuf, IMSG_CTL_LFIB_DECOUPLE, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_LFIB_DECOUPLE, 0, 0, -1, NULL, 0); printf("decouple request sent.\n"); done = 1; break; case RELOAD: - imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, NULL, 0); + imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1, NULL, 0); printf("reload request sent.\n"); done = 1; break; |