summaryrefslogtreecommitdiffstats
path: root/pimd/pim_msg.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp2020-03-061-10/+7
| | | | | | FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: fixup (S,G,rpt) prune to conform to the RFCAnuradha Karuppiah2019-11-151-27/+24
| | | | | | | | | Deviations - 1. Avoid using SPTbit setting. Replace that with Use_Spt macro. 2. If S is supposed to be forwarded along the RPT but has an empty OIL prune it. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* pimd: PIM Msg header includes N bit as defined by RFCsaravanank2019-05-151-1/+2
| | | | | | | | This commit includes parsing of Nbit and contructing pim hdr with Nbit Adding Nbit to PIm hdr structure Adding Scope zone bit and Bidir bit to Encoded IPv4 Group Address Signed-off-by: Saravanan K <saravanank@vmware.com>
* pimd: RPT Prunes do not need to be figured for a *,G PruneDonald Sharp2018-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Packet sending in PIM is a two step process. 1) Gather data size of next G to be packed into a packet. 2) Write data After 1 we need to ensure that the next G to pack will actually fit in a packet. If it does not send what we've currently written and start a new packet to send. Because this was a 2 step process it is important to be consistent in what you think you have packed -vs- what you think you should. PIM has a bug where we were considering S,G RPT Prunes for a *,G even when the *,G was being pruned. This lead to a situation where we were figuring a write size of more data then what we actually wrote into a packet. This would leave a 8 byte whole of 0's in the packet due to the way we moved pointers around. Fix the code so that we do not attempt to consider S,G rpt prunes for a *,G prune when figuring out how much we should write in step 1. Ticket: CM-21644 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Cleanup pim_msg.c to use correct pim instanceDonald Sharp2017-07-241-2/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: pim_rp.c -> convert pimg to pimDonald Sharp2017-07-241-1/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Prevent NULL dereferenceDonald Sharp2017-07-241-0/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-168/+173
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-18/+17
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: Fix WG/SGRpt & WG J/P processingChirag Shah2017-05-071-1/+3
| | | | | | | | | | | | | | | | | | | | During processing of Join/Prune, for a S,G entry, current state is SGRpt, when only *,G is received, need to clear SGRpt and add/inherit the *,G OIF to S,G so it can forward traffic to downstream where *,G is received. Upon receiving SGRpt prune remove the inherited *,G OIF. From, downstream router received *,G Prune along with SGRpt prune. Avoid sending *,G and SGRpt Prune together. Reset upstream_del reset ifchannel to NULL. Testing Done: Run failed smoke test of sending data packets, trigger SPT switchover, *,G path received SGRpt later data traffic stopped S,G ages out from LHR, sends only *,G join to upstream, verified S,G entry inherit the OIF. Upon receiving SGRpt deletes inherited oif and retains in SGRpt state. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* pimd: Start sending (S,G,rpt) Prune messagesDonald Sharp2017-03-231-60/+72
| | | | | | Start sending the (S,G,rpt) Prune messages again. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Optimize group size figuring out.Donald Sharp2017-03-231-2/+1
| | | | | | | We were figuring out the group size 2 times. Figure it out 1 time and then pass it around. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Join/Prune AggregationDonald Sharp2017-03-021-125/+50
| | | | | | | | Add the ability for PIM to send Join/Prunes as an aggregated message instead of individual messages for each S,G. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move group handling to it's own function for J/P messageDonald Sharp2017-02-241-91/+101
| | | | | | | When we are handling a J/P message, move the group handling to it's own function. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add packed data structures for building j/p messagesDonald Sharp2017-02-241-97/+69
| | | | | | | | | | Switch pim over to using packed data structures for building Join/Prune messages to be sent. This is a pre-cursor to the ability to handle the ability to aggregate Join/Prune messages together. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Assume buffer size passed in is of sufficient sizeDonald Sharp2017-02-241-42/+17
| | | | | | | | | | | | | | | | | | For: pim_msg_build_header pim_msg_addr_encode_ipv4_ucast pim_msg_addr_encode_ipv4_group pim_msg_addr_encode_ipv4_source Assume that the buffer size passed in is of sufficient size already. This is assured already because buffer sizes are checked for minimum lengths for the entire packet ahead of time. So we are double checking. Additionally at scale we will be calling these functions a very very large number of times. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add 'struct pim_msg_header' packed data structure.Donald Sharp2017-02-241-12/+7
| | | | | | | | Add the 'struct pim_msg_header' and convert all places that encoded/decoded the message header to use it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Document the J/P packet format a bit better.Donald Sharp2017-02-241-12/+75
| | | | | | | | Document the J/P packet format and ensure that the smallest size packet that we may send will actually fit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Convert sizes to #definesDonald Sharp2017-02-241-15/+9
| | | | | | | | | | Convert the const int size of the encoded types to #defines so that they can be used elsewhere. Return Null instead of 0. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: non-null register checksum incorrectChirag Shah2017-02-141-2/+11
| | | | | | | | | | | | | | Ticket: CM-12041 Reviewed By: sharpd, CCR-5556 Testing Done: Tested on Local setup generating PIM Register (Data/Null) and processing both Tx/Rx with correct checksum. Provided quagga debian to submitter and checksum cases passed on submitter setup. 1. PIM Register msg checksum only accounts for 8 bytes (4 bytes for PIM header and next 4 byetes before data payload). In PIM header checksum calculation checked PIM packet type (in this case REGISTER type) then only pass 8 bytes as length rather than full packet length. 2. PIM Register Rx path also handled with 8 byte and full pim lenth checksum. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* pimd: Cleanup the headers.Donald Sharp2017-01-191-4/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp2017-01-181-0/+3
|\
| * build: remove $Format tagsDavid Lamparter2016-12-201-2/+0
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pimd: Don't send (S,G)RPT pruneDonald Sharp2016-12-221-1/+6
| | | | | | | | | | | | | | | | Sending (S,G)RPT prune was causing issues due to not handling it properly at this point in time. So just don't send it right now Ticket: CM-13969 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pim-anycast-rp: Add limited support for secondary addresses.anuradhak2016-12-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Anycast requires that the lo interface be associated with multiple addresses. One is the anycast IP address (which is the same on all RPs participating in RP redundancy) and the second is the unique IP address that will be used as the router id by routing protocols. To accomodate that we maintain a list of secondary addresses per-pim iface and allow any of them to be the RP address. This lets the I_am_RP macro succeed on anycast RPs. Note that the support is limited i.e. we don't actually advertise a secondary list to the neighbors. This is assuming the anycast IP will never be used as a router id i.e. will never be an RPF neighbor. Sample output: ============== dell-s6000-04# sh ip pim interface lo Interface : lo State : up Address : 100.1.1.1 (primary) 100.1.1.2 100.1.1.3 100.1.2.1 >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04# sh ip pim interface lo json { "lo":{ "name":"lo", "state":"up", "address":"100.1.1.1", "index":1, "lanDelayEnabled":true, "secondaryAddressList":[ "100.1.1.2", "100.1.1.3", "100.1.2.1" ], >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04#sh ip pim rp-info RP address group/prefix-list OIF I am RP 100.1.2.1 224.0.0.0/4 lo yes dell-s6000-04# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Allow storing of sg in string formatDonald Sharp2016-12-221-9/+7
| | | | | | | | | | | | | | | | Debugs are extremely expensive currently. Let's store 'struct prefix_sg sg' string format in the ifchannel, upstream and msdp_sa structures. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Send prune(S,G,RPT) with (*,G) joinDonald Sharp2016-12-221-1/+14
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Protect debug messages.Donald Sharp2016-12-221-12/+18
| | | | | | | | | | | | Protect some debug messages from being displayed always. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Fix test for (S,G,rpt) prune inclusion.Donald Sharp2016-12-221-1/+1
| | | | | | | | | | | | | | The (S,G,rpt) prune inclusion was incorrectly considering if the RPF' was the same for (S,G) and (*,G). Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Start coding of sending Prune (s,g,rpt) with *,g prune.Donald Sharp2016-12-221-2/+51
| | | | | | | | | | | | | | | | Add logic to show that we are making decisions about the s,g,rpt prune send. We are not actually sending anything yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Pass in upstream to pim_msg_join_prune_encode.Donald Sharp2016-12-221-7/+7
| | | | | | | | | | | | | | | | Pass in the upstream data structure to pim_msg_join_prune_encode so it can decide to send (S,G,rpt) information if it wants to or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton2016-12-221-3/+3
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | PIM: prefix-list support for selecting RPDaniel Walton2016-12-221-0/+3
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: CCR-5173 Ticket: CM-12819
* | pimd: switch pim_rpf.h to use 'struct prefix' for addressDonald Sharp2016-12-221-1/+1
| | | | | | | | | | | | | | | | mrib_nexthop_addr and rpf_addr should be 'struct prefix' so that we can safely handle unnumbered data from a nexthop lookup in zebra Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Refactor RP code and start the ability to handle rangesDonald Sharp2016-12-221-1/+4
| | | | | | | | | | | | | | | | Refactor the qpim_rp into pim_rp.c so that the global data is protected. This will allow us to easily add the group ranges. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Revamp send of join/prune to actually set bits right.Donald Sharp2016-12-221-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | When a *,G report is sent, the RPT and WC bits are set as well as the source is the RP address for the group. If this routers idea of the RP for this group is different than the idea of the RP from the sender than that particular *,G can be dropped. Ticket: CM-12031 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Start abstraction for WC and RPT bitsDonald Sharp2016-12-221-4/+4
| | | | | | | | | | | | | | Start the abstraction of the WC and RPT bits so we can send the data as appropriate. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Remove unnecessary QuaggaIdDonald Sharp2016-12-221-1/+0
|/ | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Separate pim vif index spot from ifindexDonald Sharp2016-06-181-0/+2
| | | | | | | | | Allow pim to separate out the pim vif index from the ifindex. This change will allow pim to work with up to 255(MAXVIFS) interfaces, while also allowing the interface ifindex to be whatever number it needs to be. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: merge pimd as of 2015-01-19David Lamparter2016-05-261-0/+106
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 <nbahr@atcorp.com>" (which is the e-mail address listed in the associated Savannah ticket) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>