Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 871dbcf

Browse files
udhoseqvinox
authored andcommitted
[pim] Initial pim 0.155
1 parent b162ab7 commit 871dbcf

Some content is hidden

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

90 files changed

+21722
-17
lines changed

Makefile.am

+2-2
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@ @BABELD@ \
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 babeld \
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

+1
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

+53-1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ AC_ARG_ENABLE(watchquagga,
220220
[ --disable-watchquagga do not build watchquagga])
221221
AC_ARG_ENABLE(isisd,
222222
[ --enable-isisd build isisd])
223+
AC_ARG_ENABLE(pimd,
224+
[ --enable-pimd build pimd])
223225
AC_ARG_ENABLE(solaris,
224226
[ --enable-solaris build solaris])
225227
AC_ARG_ENABLE(bgp-announce,
@@ -1362,6 +1364,12 @@ case "${enable_isisd}" in
13621364
esac
13631365
AM_CONDITIONAL(ISISD, test "x$ISISD" = "xisisd")
13641366

1367+
case "${enable_pimd}" in
1368+
"yes") PIMD="pimd";;
1369+
"no" ) PIMD="";;
1370+
* ) ;;
1371+
esac
1372+
13651373
# XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
13661374
case "${enable_solaris}" in
13671375
"yes") SOLARIS="solaris";;
@@ -1385,6 +1393,7 @@ AC_SUBST(OSPF6D)
13851393
AC_SUBST(BABELD)
13861394
AC_SUBST(WATCHQUAGGA)
13871395
AC_SUBST(ISISD)
1396+
AC_SUBST(PIMD)
13881397
AC_SUBST(SOLARIS)
13891398
AC_SUBST(VTYSH)
13901399
AC_SUBST(INCLUDES)
@@ -1467,7 +1476,8 @@ dnl sockaddr and netinet checks
14671476
dnl ---------------------------
14681477
AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
14691478
struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
1470-
socklen_t,
1479+
socklen_t, struct vifctl, struct mfcctl, struct sioc_sg_req,
1480+
vifi_t, struct sioc_vif_req, struct igmpmsg,
14711481
struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
14721482
struct nd_opt_adv_interval, struct rt_addrinfo,
14731483
struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
@@ -1496,6 +1506,45 @@ AC_CHECK_TYPES([struct in_pktinfo],
14961506
AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
14971507
fi], [QUAGGA_INCLUDES])
14981508

1509+
dnl -----------------------
1510+
dnl checking for IP_PKTINFO
1511+
dnl -----------------------
1512+
AC_MSG_CHECKING(for IP_PKTINFO)
1513+
AC_TRY_COMPILE([#include <netdb.h>], [
1514+
int opt = IP_PKTINFO;
1515+
], [
1516+
AC_MSG_RESULT(yes)
1517+
AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1518+
], [
1519+
AC_MSG_RESULT(no)
1520+
])
1521+
1522+
dnl ---------------------------
1523+
dnl checking for IP_RECVDSTADDR
1524+
dnl ---------------------------
1525+
AC_MSG_CHECKING(for IP_RECVDSTADDR)
1526+
AC_TRY_COMPILE([#include <netinet/in.h>], [
1527+
int opt = IP_RECVDSTADDR;
1528+
], [
1529+
AC_MSG_RESULT(yes)
1530+
AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
1531+
], [
1532+
AC_MSG_RESULT(no)
1533+
])
1534+
1535+
dnl ----------------------
1536+
dnl checking for IP_RECVIF
1537+
dnl ----------------------
1538+
AC_MSG_CHECKING(for IP_RECVIF)
1539+
AC_TRY_COMPILE([#include <netinet/in.h>], [
1540+
int opt = IP_RECVIF;
1541+
], [
1542+
AC_MSG_RESULT(yes)
1543+
AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
1544+
], [
1545+
AC_MSG_RESULT(no)
1546+
])
1547+
14991548
dnl --------------------------------------
15001549
dnl checking for getrusage struct and call
15011550
dnl --------------------------------------
@@ -1685,6 +1734,7 @@ AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
16851734
AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
16861735
AC_DEFINE_UNQUOTED(PATH_BABELD_PID, "$quagga_statedir/babeld.pid",babeld PID)
16871736
AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
1737+
AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$quagga_statedir/pimd.pid",pimd PID)
16881738
AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
16891739
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
16901740
AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
@@ -1695,6 +1745,7 @@ AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socke
16951745
AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
16961746
AC_DEFINE_UNQUOTED(BABEL_VTYSH_PATH, "$quagga_statedir/babeld.vty",babeld vty socket)
16971747
AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
1748+
AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket)
16981749
AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
16991750

17001751
dnl -------------------------------
@@ -1720,6 +1771,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
17201771
ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
17211772
ospf6d/Makefile isisd/Makefile babeld/Makefile vtysh/Makefile
17221773
doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
1774+
pimd/Makefile
17231775
tests/bgpd.tests/Makefile
17241776
tests/libzebra.tests/Makefile
17251777
redhat/Makefile

doc/Makefile.am

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ quagga_TEXINFOS = appendix.texi babeld.texi basic.texi bgpd.texi filter.texi \
6161
.dia.png:
6262
$(DIATOPNG) "$@" $<
6363

64-
man_MANS =
64+
if PIMD
65+
man_MANS += pimd.8
66+
endif
6567

6668
if BGPD
6769
man_MANS += bgpd.8

doc/install.texi

+1
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

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

lib/command.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Zebra configuration command interface routine
33
* Copyright (C) 1997, 98 Kunihiro Ishiguro
4+
* Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
45
*
56
* This file is part of GNU Zebra.
67
*
@@ -88,6 +89,7 @@ enum node_type
8889
OSPF_NODE, /* OSPF protocol mode */
8990
OSPF6_NODE, /* OSPF protocol for IPv6 mode */
9091
ISIS_NODE, /* ISIS protocol mode */
92+
PIM_NODE, /* PIM protocol mode */
9193
MASC_NODE, /* MASC for multicast. */
9294
IRDP_NODE, /* ICMP Router Discovery Protocol mode. */
9395
IP_NODE, /* Static ip route node. */

lib/log.c

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Logging of zebra
33
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
4+
* Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
45
*
56
* This file is part of GNU Zebra.
67
*
@@ -51,6 +52,7 @@ const char *zlog_proto_names[] =
5152
"BABEL",
5253
"OSPF6",
5354
"ISIS",
55+
"PIM",
5456
"MASC",
5557
NULL,
5658
};

lib/log.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Zebra logging funcions.
33
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
4+
* Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
45
*
56
* This file is part of GNU Zebra.
67
*
@@ -53,6 +54,7 @@ typedef enum
5354
ZLOG_BABEL,
5455
ZLOG_OSPF6,
5556
ZLOG_ISIS,
57+
ZLOG_PIM,
5658
ZLOG_MASC
5759
} zlog_proto_t;
5860

lib/memory.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Memory management routine
33
* Copyright (C) 1998 Kunihiro Ishiguro
4+
* Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
45
*
56
* This file is part of GNU Zebra.
67
*
@@ -521,6 +522,17 @@ DEFUN (show_memory_isis,
521522
return CMD_SUCCESS;
522523
}
523524

525+
DEFUN (show_memory_pim,
526+
show_memory_pim_cmd,
527+
"show memory pim",
528+
SHOW_STR
529+
"Memory statistics\n"
530+
"PIM memory\n")
531+
{
532+
show_memory_vty (vty, memory_list_pim);
533+
return CMD_SUCCESS;
534+
}
535+
524536
void
525537
memory_init (void)
526538
{
@@ -545,6 +557,7 @@ memory_init (void)
545557
install_element (VIEW_NODE, &show_memory_ospf_cmd);
546558
install_element (VIEW_NODE, &show_memory_ospf6_cmd);
547559
install_element (VIEW_NODE, &show_memory_isis_cmd);
560+
install_element (VIEW_NODE, &show_memory_pim_cmd);
548561

549562
install_element (ENABLE_NODE, &show_memory_cmd);
550563
install_element (ENABLE_NODE, &show_memory_all_cmd);
@@ -556,7 +569,7 @@ memory_init (void)
556569
install_element (ENABLE_NODE, &show_memory_bgp_cmd);
557570
install_element (ENABLE_NODE, &show_memory_ospf_cmd);
558571
install_element (ENABLE_NODE, &show_memory_ospf6_cmd);
559-
install_element (ENABLE_NODE, &show_memory_isis_cmd);
572+
install_element (ENABLE_NODE, &show_memory_pim_cmd);
560573
}
561574

562575
/* Stats querying from users */

lib/memtypes.c

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
* Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
3+
*
24
* Memory type definitions. This file is parsed by memtypes.awk to extract
35
* MTYPE_ and memory_list_.. information in order to autogenerate
46
* memtypes.h.
@@ -255,6 +257,20 @@ struct memory_list memory_list_isis[] =
255257
{ -1, NULL },
256258
};
257259

260+
struct memory_list memory_list_pim[] =
261+
{
262+
{ MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
263+
{ MTYPE_PIM_INTERFACE, "PIM interface" },
264+
{ MTYPE_PIM_IGMP_JOIN, "PIM interface IGMP static join" },
265+
{ MTYPE_PIM_IGMP_SOCKET, "PIM interface IGMP socket" },
266+
{ MTYPE_PIM_IGMP_GROUP, "PIM interface IGMP group" },
267+
{ MTYPE_PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source" },
268+
{ MTYPE_PIM_NEIGHBOR, "PIM interface neighbor" },
269+
{ MTYPE_PIM_IFCHANNEL, "PIM interface (S,G) state" },
270+
{ MTYPE_PIM_UPSTREAM, "PIM upstream (S,G) state" },
271+
{ -1, NULL },
272+
};
273+
258274
struct memory_list memory_list_vtysh[] =
259275
{
260276
{ MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
@@ -271,5 +287,6 @@ struct mlist mlists[] __attribute__ ((unused)) = {
271287
{ memory_list_ospf6, "OSPF6" },
272288
{ memory_list_isis, "ISIS" },
273289
{ memory_list_bgp, "BGP" },
290+
{ memory_list_pim, "PIM" },
274291
{ NULL, NULL},
275292
};

0 commit comments

Comments
 (0)