Skip to content

Commit 12e41d0

Browse files
eqvinoxDonald Sharp
authored and
Donald Sharp
committed
pimd: merge pimd as of 2015-01-19
Welcome pimd to the Quagga daemon zoo! This is a merge of commit 77ae369 ("pimd: Log ifindex found for an interface when zebra lib reports a new connected address."), with the intermediate "reconnect" changes removed (c9adf00...d274381). d274381 is replaced with b162ab7, which includes some changes. In addition, 4 reconnect-related changes and 1 cosmetic one have been bumped out. The rebase command used to produce the branch that is merged here is: git rebase --onto b162ab7 c9adf00 77ae369 Note that 3 patches had their author rewritten from "Anonymous SR#108542 <>" (which is not a valid git author ID) to: "Savannah SR#108542 <[email protected]>" (which is the e-mail address listed in the associated Savannah ticket) Signed-off-by: David Lamparter <[email protected]>
1 parent 5b282f5 commit 12e41d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+23920
-9
lines changed

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Process this file with automake to produce Makefile.in.
22

33
SUBDIRS = lib @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
4-
@ISISD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \
4+
@ISISD@ @PIMD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \
55
redhat @SOLARIS@ tests
66

77
DIST_SUBDIRS = lib zebra bgpd ripd ripngd ospfd ospf6d \
88
isisd watchquagga vtysh ospfclient doc m4 pkgsrc redhat tests \
9-
solaris
9+
solaris pimd
1010

1111
EXTRA_DIST = aclocal.m4 SERVICES TODO REPORTING-BUGS INSTALL.quagga.txt \
1212
update-autotools \

SERVICES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ bgpd 2605/tcp
1717
ospf6d 2606/tcp
1818
ospfapi 2607/tcp
1919
isisd 2608/tcp
20+
pimd 2611/tcp

configure.ac

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ AC_ARG_ENABLE(watchquagga,
236236
[ --disable-watchquagga do not build watchquagga])
237237
AC_ARG_ENABLE(isisd,
238238
[ --enable-isisd build isisd])
239+
AC_ARG_ENABLE(pimd,
240+
[ --enable-pimd build pimd])
239241
AC_ARG_ENABLE(solaris,
240242
[ --enable-solaris build solaris])
241243
AC_ARG_ENABLE(bgp-announce,
@@ -1382,6 +1384,13 @@ case "${enable_isisd}" in
13821384
esac
13831385
AM_CONDITIONAL(ISISD, test "x$ISISD" = "xisisd")
13841386

1387+
case "${enable_pimd}" in
1388+
"yes") PIMD="pimd";;
1389+
"no" ) PIMD="";;
1390+
* ) ;;
1391+
esac
1392+
AM_CONDITIONAL(PIMD, test "x$PIMD" = "xpimd")
1393+
13851394
# XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
13861395
case "${enable_solaris}" in
13871396
"yes") SOLARIS="solaris";;
@@ -1404,6 +1413,7 @@ AC_SUBST(OSPFD)
14041413
AC_SUBST(OSPF6D)
14051414
AC_SUBST(WATCHQUAGGA)
14061415
AC_SUBST(ISISD)
1416+
AC_SUBST(PIMD)
14071417
AC_SUBST(SOLARIS)
14081418
AC_SUBST(VTYSH)
14091419
AC_SUBST(INCLUDES)
@@ -1486,7 +1496,8 @@ dnl sockaddr and netinet checks
14861496
dnl ---------------------------
14871497
AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
14881498
struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
1489-
socklen_t,
1499+
socklen_t, struct vifctl, struct mfcctl, struct sioc_sg_req,
1500+
vifi_t, struct sioc_vif_req, struct igmpmsg,
14901501
struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
14911502
struct nd_opt_adv_interval, struct rt_addrinfo,
14921503
struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
@@ -1515,6 +1526,45 @@ AC_CHECK_TYPES([struct in_pktinfo],
15151526
AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
15161527
fi], [QUAGGA_INCLUDES])
15171528

1529+
dnl -----------------------
1530+
dnl checking for IP_PKTINFO
1531+
dnl -----------------------
1532+
AC_MSG_CHECKING(for IP_PKTINFO)
1533+
AC_TRY_COMPILE([#include <netdb.h>], [
1534+
int opt = IP_PKTINFO;
1535+
], [
1536+
AC_MSG_RESULT(yes)
1537+
AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1538+
], [
1539+
AC_MSG_RESULT(no)
1540+
])
1541+
1542+
dnl ---------------------------
1543+
dnl checking for IP_RECVDSTADDR
1544+
dnl ---------------------------
1545+
AC_MSG_CHECKING(for IP_RECVDSTADDR)
1546+
AC_TRY_COMPILE([#include <netinet/in.h>], [
1547+
int opt = IP_RECVDSTADDR;
1548+
], [
1549+
AC_MSG_RESULT(yes)
1550+
AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
1551+
], [
1552+
AC_MSG_RESULT(no)
1553+
])
1554+
1555+
dnl ----------------------
1556+
dnl checking for IP_RECVIF
1557+
dnl ----------------------
1558+
AC_MSG_CHECKING(for IP_RECVIF)
1559+
AC_TRY_COMPILE([#include <netinet/in.h>], [
1560+
int opt = IP_RECVIF;
1561+
], [
1562+
AC_MSG_RESULT(yes)
1563+
AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
1564+
], [
1565+
AC_MSG_RESULT(no)
1566+
])
1567+
15181568
dnl --------------------------------------
15191569
dnl checking for getrusage struct and call
15201570
dnl --------------------------------------
@@ -1687,6 +1737,7 @@ AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
16871737
AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
16881738
AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
16891739
AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
1740+
AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$quagga_statedir/pimd.pid",pimd PID)
16901741
AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
16911742
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
16921743
AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
@@ -1696,6 +1747,7 @@ AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
16961747
AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
16971748
AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
16981749
AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
1750+
AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket)
16991751
AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
17001752

17011753
dnl -------------------------------
@@ -1721,6 +1773,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
17211773
ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
17221774
ospf6d/Makefile isisd/Makefile vtysh/Makefile
17231775
doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
1776+
pimd/Makefile
17241777
tests/bgpd.tests/Makefile
17251778
tests/libzebra.tests/Makefile
17261779
redhat/Makefile

doc/Makefile.am

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ quagga_TEXINFOS = appendix.texi basic.texi bgpd.texi filter.texi \
6363

6464
man_MANS = quagga.1
6565

66+
if PIMD
67+
man_MANS += pimd.8
68+
endif
69+
6670
if BGPD
6771
man_MANS += bgpd.8
6872
endif
@@ -105,7 +109,7 @@ endif
105109

106110
EXTRA_DIST = BGP-TypeCode draft-zebra-00.ms draft-zebra-00.txt \
107111
bgpd.8 isisd.8 ospf6d.8 ospfclient.8 ospfd.8 ripd.8 \
108-
ripngd.8 vtysh.1 watchquagga.8 zebra.8 \
112+
ripngd.8 pimd.8 vtysh.1 watchquagga.8 zebra.8 \
109113
mpls/ChangeLog.opaque.txt mpls/cli_summary.txt \
110114
mpls/opaque_lsa.txt mpls/ospfd.conf \
111115
$(figures_sources) $(figures_png) $(figures_txt)

doc/install.texi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ bgpd 2605/tcp # BGPd vty
273273
ospf6d 2606/tcp # OSPF6d vty
274274
ospfapi 2607/tcp # ospfapi
275275
isisd 2608/tcp # ISISd vty
276+
pimd 2611/tcp # PIMd vty
276277
@end example
277278

278279
If you use a FreeBSD newer than 2.2.8, the above entries are already

doc/pimd.8

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
.TH PIM 8 "10 December 2008" "Quagga PIM daemon" "Version 0.99.11"
2+
.SH NAME
3+
pimd \- a PIM routing for use with Quagga Routing Suite.
4+
.SH SYNOPSIS
5+
.B pimd
6+
[
7+
.B \-dhvZ
8+
] [
9+
.B \-f
10+
.I config-file
11+
] [
12+
.B \-i
13+
.I pid-file
14+
] [
15+
.B \-z
16+
.I path
17+
] [
18+
.B \-P
19+
.I port-number
20+
] [
21+
.B \-A
22+
.I vty-address
23+
] [
24+
.B \-u
25+
.I user
26+
] [
27+
.B \-g
28+
.I group
29+
]
30+
.SH DESCRIPTION
31+
.B pimd
32+
is a protocol-independent multicast component that works with the
33+
.B Quagga
34+
Routing Suite.
35+
.SH OPTIONS
36+
Options available for the
37+
.B pimd
38+
command:
39+
.TP
40+
\fB\-d\fR, \fB\-\-daemon\fR
41+
Runs in daemon mode, forking and exiting from tty.
42+
.TP
43+
\fB\-f\fR, \fB\-\-config-file \fR\fIconfig-file\fR
44+
Specifies the config file to use for startup. If not specified this
45+
option will likely default to \fB\fI/usr/local/etc/pimd.conf\fR.
46+
.TP
47+
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
48+
Specify the group to run as. Default is \fIquagga\fR.
49+
.TP
50+
\fB\-h\fR, \fB\-\-help\fR
51+
A brief message.
52+
.TP
53+
\fB\-i\fR, \fB\-\-pid_file \fR\fIpid-file\fR
54+
When pimd starts its process identifier is written to
55+
\fB\fIpid-file\fR. The init system uses the recorded PID to stop or
56+
restart pimd. The likely default is \fB\fI/var/run/pimd.pid\fR.
57+
.TP
58+
\fB\-z\fR, \fB\-\-socket \fR\fIpath\fR
59+
Specify the socket path for contacting the zebra daemon.
60+
The likely default is \fB\fI/var/run/zserv.api\fR.
61+
.TP
62+
\fB\-P\fR, \fB\-\-vty_port \fR\fIport-number\fR
63+
Specify the port that the pimd VTY will listen on. This defaults to
64+
2611, as specified in \fB\fI/etc/services\fR.
65+
.TP
66+
\fB\-A\fR, \fB\-\-vty_addr \fR\fIvty-address\fR
67+
Specify the address that the pimd VTY will listen on. Default is all
68+
interfaces.
69+
.TP
70+
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
71+
Specify the user to run as. Default is \fIquagga\fR.
72+
.TP
73+
\fB\-v\fR, \fB\-\-version\fR
74+
Print the version and exit.
75+
.TP
76+
\fB\-Z\fR, \fB\-\-debug_zclient\fR
77+
Enable logging information for zclient debugging.
78+
.SH FILES
79+
.TP
80+
.BI /usr/local/sbin/pimd
81+
The default location of the
82+
.B pimd
83+
binary.
84+
.TP
85+
.BI /usr/local/etc/pimd.conf
86+
The default location of the
87+
.B pimd
88+
config file.
89+
.TP
90+
.BI /var/run/pimd.pid
91+
The default location of the
92+
.B pimd
93+
pid file.
94+
.TP
95+
.BI /var/run/zserv.api
96+
The default location of the
97+
.B zebra
98+
unix socket file.
99+
.TP
100+
.BI $(PWD)/pimd.log
101+
If the
102+
.B pimd
103+
process is config'd to output logs to a file, then you will find this
104+
file in the directory where you started \fBpimd\fR.
105+
.SH WARNING
106+
This man page is intended to be a quick reference for command line
107+
options.
108+
.SH DIAGNOSTICS
109+
The pimd process may log to standard output, to a VTY, to a log
110+
file, or through syslog to the system logs.
111+
.SH "SEE ALSO"
112+
.BR zebra (8),
113+
.BR vtysh (1)
114+
.SH BUGS
115+
\fBpimd\fR is in early development at the moment and is not ready for
116+
production use.
117+
118+
.B pimd
119+
eats bugs for breakfast. If you have food for the maintainers try
120+
.BI https://github.com/udhos/qpimd
121+
.SH AUTHORS
122+
See
123+
.BI https://github.com/udhos/qpimd
124+
for an accurate list of authors.
125+

lib/command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,6 +2943,7 @@ DEFUN (config_exit,
29432943
case KEYCHAIN_NODE:
29442944
case MASC_NODE:
29452945
case RMAP_NODE:
2946+
case PIM_NODE:
29462947
case VTY_NODE:
29472948
vty->node = CONFIG_NODE;
29482949
break;
@@ -3000,6 +3001,7 @@ DEFUN (config_end,
30003001
case KEYCHAIN_NODE:
30013002
case KEYCHAIN_KEY_NODE:
30023003
case MASC_NODE:
3004+
case PIM_NODE:
30033005
case VTY_NODE:
30043006
vty_config_unlock (vty);
30053007
vty->node = ENABLE_NODE;

lib/command.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ enum node_type
8989
OSPF_NODE, /* OSPF protocol mode */
9090
OSPF6_NODE, /* OSPF protocol for IPv6 mode */
9191
ISIS_NODE, /* ISIS protocol mode */
92+
PIM_NODE, /* PIM protocol mode */
9293
MASC_NODE, /* MASC for multicast. */
9394
IRDP_NODE, /* ICMP Router Discovery Protocol mode. */
9495
IP_NODE, /* Static ip route node. */

lib/log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const char *zlog_proto_names[] =
5050
"RIPNG",
5151
"OSPF6",
5252
"ISIS",
53+
"PIM",
5354
"MASC",
5455
NULL,
5556
};

lib/log.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ typedef enum
5252
ZLOG_RIPNG,
5353
ZLOG_OSPF6,
5454
ZLOG_ISIS,
55+
ZLOG_PIM,
5556
ZLOG_MASC
5657
} zlog_proto_t;
5758

lib/memory.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,17 @@ DEFUN (show_memory,
416416
}
417417

418418

419+
DEFUN (show_memory_pim,
420+
show_memory_pim_cmd,
421+
"show memory pim",
422+
SHOW_STR
423+
"Memory statistics\n"
424+
"PIM memory\n")
425+
{
426+
show_memory_vty (vty, memory_list_pim);
427+
return CMD_SUCCESS;
428+
}
429+
419430
void
420431
memory_init (void)
421432
{

lib/memtypes.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,21 @@ struct memory_list memory_list_isis[] =
271271
{ -1, NULL },
272272
};
273273

274+
struct memory_list memory_list_pim[] =
275+
{
276+
{ MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
277+
{ MTYPE_PIM_INTERFACE, "PIM interface" },
278+
{ MTYPE_PIM_IGMP_JOIN, "PIM interface IGMP static join" },
279+
{ MTYPE_PIM_IGMP_SOCKET, "PIM interface IGMP socket" },
280+
{ MTYPE_PIM_IGMP_GROUP, "PIM interface IGMP group" },
281+
{ MTYPE_PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source" },
282+
{ MTYPE_PIM_NEIGHBOR, "PIM interface neighbor" },
283+
{ MTYPE_PIM_IFCHANNEL, "PIM interface (S,G) state" },
284+
{ MTYPE_PIM_UPSTREAM, "PIM upstream (S,G) state" },
285+
{ MTYPE_PIM_SSMPINGD, "PIM sspimgd socket" },
286+
{ -1, NULL },
287+
};
288+
274289
struct memory_list memory_list_vtysh[] =
275290
{
276291
{ MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
@@ -287,5 +302,6 @@ struct mlist mlists[] __attribute__ ((unused)) = {
287302
{ memory_list_ospf6, "OSPF6" },
288303
{ memory_list_isis, "ISIS" },
289304
{ memory_list_bgp, "BGP" },
305+
{ memory_list_pim, "PIM" },
290306
{ NULL, NULL},
291307
};

lib/route_types.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd, 'O', 1, 0, "OSPF"
5151
ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPFv6"
5252
ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS"
5353
ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP"
54+
ZEBRA_ROUTE_PIM, pim, pimd, 'P', 1, 0, "PIM"
5455
# HSLS and OLSR both are AFI independent (so: 1, 1), however
5556
# we want to disable for them for general Quagga distribution.
5657
# This at least makes it trivial for users of these protocols
@@ -71,6 +72,7 @@ ZEBRA_ROUTE_OSPF, "Open Shortest Path First (OSPFv2)"
7172
ZEBRA_ROUTE_OSPF6, "Open Shortest Path First (IPv6) (OSPFv3)"
7273
ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)"
7374
ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)"
75+
ZEBRA_ROUTE_PIM, "Protocol Independent Multicast (PIM)"
7476
ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)"
7577
ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)"
7678
ZEBRA_ROUTE_TABLE, "Non-main Kernel Routing Table"

lib/thread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* Thread management routine header.
22
* Copyright (C) 1998 Kunihiro Ishiguro
3-
* Portions Copyright (c) 2008 Everton da Silva Marques <[email protected]>
43
*
54
* This file is part of GNU Zebra.
65
*

0 commit comments

Comments
 (0)