Skip to content

Commit

Permalink
pimd: merge pimd as of 2015-01-19
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
eqvinox authored and Donald Sharp committed May 26, 2016
1 parent 5b282f5 commit 12e41d0
Show file tree
Hide file tree
Showing 109 changed files with 23,920 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Process this file with automake to produce Makefile.in.

SUBDIRS = lib @ZEBRA@ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ \
@ISISD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \
@ISISD@ @PIMD@ @WATCHQUAGGA@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \
redhat @SOLARIS@ tests

DIST_SUBDIRS = lib zebra bgpd ripd ripngd ospfd ospf6d \
isisd watchquagga vtysh ospfclient doc m4 pkgsrc redhat tests \
solaris
solaris pimd

EXTRA_DIST = aclocal.m4 SERVICES TODO REPORTING-BUGS INSTALL.quagga.txt \
update-autotools \
Expand Down
1 change: 1 addition & 0 deletions SERVICES
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ bgpd 2605/tcp
ospf6d 2606/tcp
ospfapi 2607/tcp
isisd 2608/tcp
pimd 2611/tcp
55 changes: 54 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ AC_ARG_ENABLE(watchquagga,
[ --disable-watchquagga do not build watchquagga])
AC_ARG_ENABLE(isisd,
[ --enable-isisd build isisd])
AC_ARG_ENABLE(pimd,
[ --enable-pimd build pimd])
AC_ARG_ENABLE(solaris,
[ --enable-solaris build solaris])
AC_ARG_ENABLE(bgp-announce,
Expand Down Expand Up @@ -1382,6 +1384,13 @@ case "${enable_isisd}" in
esac
AM_CONDITIONAL(ISISD, test "x$ISISD" = "xisisd")

case "${enable_pimd}" in
"yes") PIMD="pimd";;
"no" ) PIMD="";;
* ) ;;
esac
AM_CONDITIONAL(PIMD, test "x$PIMD" = "xpimd")

# XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
case "${enable_solaris}" in
"yes") SOLARIS="solaris";;
Expand All @@ -1404,6 +1413,7 @@ AC_SUBST(OSPFD)
AC_SUBST(OSPF6D)
AC_SUBST(WATCHQUAGGA)
AC_SUBST(ISISD)
AC_SUBST(PIMD)
AC_SUBST(SOLARIS)
AC_SUBST(VTYSH)
AC_SUBST(INCLUDES)
Expand Down Expand Up @@ -1486,7 +1496,8 @@ dnl sockaddr and netinet checks
dnl ---------------------------
AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
socklen_t,
socklen_t, struct vifctl, struct mfcctl, struct sioc_sg_req,
vifi_t, struct sioc_vif_req, struct igmpmsg,
struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
struct nd_opt_adv_interval, struct rt_addrinfo,
struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
Expand Down Expand Up @@ -1515,6 +1526,45 @@ AC_CHECK_TYPES([struct in_pktinfo],
AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
fi], [QUAGGA_INCLUDES])

dnl -----------------------
dnl checking for IP_PKTINFO
dnl -----------------------
AC_MSG_CHECKING(for IP_PKTINFO)
AC_TRY_COMPILE([#include <netdb.h>], [
int opt = IP_PKTINFO;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
], [
AC_MSG_RESULT(no)
])

dnl ---------------------------
dnl checking for IP_RECVDSTADDR
dnl ---------------------------
AC_MSG_CHECKING(for IP_RECVDSTADDR)
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVDSTADDR;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
], [
AC_MSG_RESULT(no)
])

dnl ----------------------
dnl checking for IP_RECVIF
dnl ----------------------
AC_MSG_CHECKING(for IP_RECVIF)
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVIF;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
], [
AC_MSG_RESULT(no)
])

dnl --------------------------------------
dnl checking for getrusage struct and call
dnl --------------------------------------
Expand Down Expand Up @@ -1687,6 +1737,7 @@ AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$quagga_statedir/pimd.pid",pimd PID)
AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
Expand All @@ -1696,6 +1747,7 @@ AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket)
AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)

dnl -------------------------------
Expand All @@ -1721,6 +1773,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
ospf6d/Makefile isisd/Makefile vtysh/Makefile
doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
pimd/Makefile
tests/bgpd.tests/Makefile
tests/libzebra.tests/Makefile
redhat/Makefile
Expand Down
6 changes: 5 additions & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ quagga_TEXINFOS = appendix.texi basic.texi bgpd.texi filter.texi \

man_MANS = quagga.1

if PIMD
man_MANS += pimd.8
endif

if BGPD
man_MANS += bgpd.8
endif
Expand Down Expand Up @@ -105,7 +109,7 @@ endif

EXTRA_DIST = BGP-TypeCode draft-zebra-00.ms draft-zebra-00.txt \
bgpd.8 isisd.8 ospf6d.8 ospfclient.8 ospfd.8 ripd.8 \
ripngd.8 vtysh.1 watchquagga.8 zebra.8 \
ripngd.8 pimd.8 vtysh.1 watchquagga.8 zebra.8 \
mpls/ChangeLog.opaque.txt mpls/cli_summary.txt \
mpls/opaque_lsa.txt mpls/ospfd.conf \
$(figures_sources) $(figures_png) $(figures_txt)
Expand Down
1 change: 1 addition & 0 deletions doc/install.texi
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ bgpd 2605/tcp # BGPd vty
ospf6d 2606/tcp # OSPF6d vty
ospfapi 2607/tcp # ospfapi
isisd 2608/tcp # ISISd vty
pimd 2611/tcp # PIMd vty
@end example

If you use a FreeBSD newer than 2.2.8, the above entries are already
Expand Down
125 changes: 125 additions & 0 deletions doc/pimd.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.TH PIM 8 "10 December 2008" "Quagga PIM daemon" "Version 0.99.11"
.SH NAME
pimd \- a PIM routing for use with Quagga Routing Suite.
.SH SYNOPSIS
.B pimd
[
.B \-dhvZ
] [
.B \-f
.I config-file
] [
.B \-i
.I pid-file
] [
.B \-z
.I path
] [
.B \-P
.I port-number
] [
.B \-A
.I vty-address
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B pimd
is a protocol-independent multicast component that works with the
.B Quagga
Routing Suite.
.SH OPTIONS
Options available for the
.B pimd
command:
.TP
\fB\-d\fR, \fB\-\-daemon\fR
Runs in daemon mode, forking and exiting from tty.
.TP
\fB\-f\fR, \fB\-\-config-file \fR\fIconfig-file\fR
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/pimd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
\fB\-i\fR, \fB\-\-pid_file \fR\fIpid-file\fR
When pimd starts its process identifier is written to
\fB\fIpid-file\fR. The init system uses the recorded PID to stop or
restart pimd. The likely default is \fB\fI/var/run/pimd.pid\fR.
.TP
\fB\-z\fR, \fB\-\-socket \fR\fIpath\fR
Specify the socket path for contacting the zebra daemon.
The likely default is \fB\fI/var/run/zserv.api\fR.
.TP
\fB\-P\fR, \fB\-\-vty_port \fR\fIport-number\fR
Specify the port that the pimd VTY will listen on. This defaults to
2611, as specified in \fB\fI/etc/services\fR.
.TP
\fB\-A\fR, \fB\-\-vty_addr \fR\fIvty-address\fR
Specify the address that the pimd VTY will listen on. Default is all
interfaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-v\fR, \fB\-\-version\fR
Print the version and exit.
.TP
\fB\-Z\fR, \fB\-\-debug_zclient\fR
Enable logging information for zclient debugging.
.SH FILES
.TP
.BI /usr/local/sbin/pimd
The default location of the
.B pimd
binary.
.TP
.BI /usr/local/etc/pimd.conf
The default location of the
.B pimd
config file.
.TP
.BI /var/run/pimd.pid
The default location of the
.B pimd
pid file.
.TP
.BI /var/run/zserv.api
The default location of the
.B zebra
unix socket file.
.TP
.BI $(PWD)/pimd.log
If the
.B pimd
process is config'd to output logs to a file, then you will find this
file in the directory where you started \fBpimd\fR.
.SH WARNING
This man page is intended to be a quick reference for command line
options.
.SH DIAGNOSTICS
The pimd process may log to standard output, to a VTY, to a log
file, or through syslog to the system logs.
.SH "SEE ALSO"
.BR zebra (8),
.BR vtysh (1)
.SH BUGS
\fBpimd\fR is in early development at the moment and is not ready for
production use.

.B pimd
eats bugs for breakfast. If you have food for the maintainers try
.BI https://github.com/udhos/qpimd
.SH AUTHORS
See
.BI https://github.com/udhos/qpimd
for an accurate list of authors.

2 changes: 2 additions & 0 deletions lib/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,7 @@ DEFUN (config_exit,
case KEYCHAIN_NODE:
case MASC_NODE:
case RMAP_NODE:
case PIM_NODE:
case VTY_NODE:
vty->node = CONFIG_NODE;
break;
Expand Down Expand Up @@ -3000,6 +3001,7 @@ DEFUN (config_end,
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
case MASC_NODE:
case PIM_NODE:
case VTY_NODE:
vty_config_unlock (vty);
vty->node = ENABLE_NODE;
Expand Down
1 change: 1 addition & 0 deletions lib/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum node_type
OSPF_NODE, /* OSPF protocol mode */
OSPF6_NODE, /* OSPF protocol for IPv6 mode */
ISIS_NODE, /* ISIS protocol mode */
PIM_NODE, /* PIM protocol mode */
MASC_NODE, /* MASC for multicast. */
IRDP_NODE, /* ICMP Router Discovery Protocol mode. */
IP_NODE, /* Static ip route node. */
Expand Down
1 change: 1 addition & 0 deletions lib/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const char *zlog_proto_names[] =
"RIPNG",
"OSPF6",
"ISIS",
"PIM",
"MASC",
NULL,
};
Expand Down
1 change: 1 addition & 0 deletions lib/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ typedef enum
ZLOG_RIPNG,
ZLOG_OSPF6,
ZLOG_ISIS,
ZLOG_PIM,
ZLOG_MASC
} zlog_proto_t;

Expand Down
11 changes: 11 additions & 0 deletions lib/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,17 @@ DEFUN (show_memory,
}


DEFUN (show_memory_pim,
show_memory_pim_cmd,
"show memory pim",
SHOW_STR
"Memory statistics\n"
"PIM memory\n")
{
show_memory_vty (vty, memory_list_pim);
return CMD_SUCCESS;
}

void
memory_init (void)
{
Expand Down
16 changes: 16 additions & 0 deletions lib/memtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,21 @@ struct memory_list memory_list_isis[] =
{ -1, NULL },
};

struct memory_list memory_list_pim[] =
{
{ MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
{ MTYPE_PIM_INTERFACE, "PIM interface" },
{ MTYPE_PIM_IGMP_JOIN, "PIM interface IGMP static join" },
{ MTYPE_PIM_IGMP_SOCKET, "PIM interface IGMP socket" },
{ MTYPE_PIM_IGMP_GROUP, "PIM interface IGMP group" },
{ MTYPE_PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source" },
{ MTYPE_PIM_NEIGHBOR, "PIM interface neighbor" },
{ MTYPE_PIM_IFCHANNEL, "PIM interface (S,G) state" },
{ MTYPE_PIM_UPSTREAM, "PIM upstream (S,G) state" },
{ MTYPE_PIM_SSMPINGD, "PIM sspimgd socket" },
{ -1, NULL },
};

struct memory_list memory_list_vtysh[] =
{
{ MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
Expand All @@ -287,5 +302,6 @@ struct mlist mlists[] __attribute__ ((unused)) = {
{ memory_list_ospf6, "OSPF6" },
{ memory_list_isis, "ISIS" },
{ memory_list_bgp, "BGP" },
{ memory_list_pim, "PIM" },
{ NULL, NULL},
};
2 changes: 2 additions & 0 deletions lib/route_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd, 'O', 1, 0, "OSPF"
ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPFv6"
ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS"
ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP"
ZEBRA_ROUTE_PIM, pim, pimd, 'P', 1, 0, "PIM"
# HSLS and OLSR both are AFI independent (so: 1, 1), however
# we want to disable for them for general Quagga distribution.
# This at least makes it trivial for users of these protocols
Expand All @@ -71,6 +72,7 @@ ZEBRA_ROUTE_OSPF, "Open Shortest Path First (OSPFv2)"
ZEBRA_ROUTE_OSPF6, "Open Shortest Path First (IPv6) (OSPFv3)"
ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)"
ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)"
ZEBRA_ROUTE_PIM, "Protocol Independent Multicast (PIM)"
ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)"
ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)"
ZEBRA_ROUTE_TABLE, "Non-main Kernel Routing Table"
1 change: 0 additions & 1 deletion lib/thread.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Thread management routine header.
* Copyright (C) 1998 Kunihiro Ishiguro
* Portions Copyright (c) 2008 Everton da Silva Marques <[email protected]>
*
* This file is part of GNU Zebra.
*
Expand Down
Loading

0 comments on commit 12e41d0

Please sign in to comment.