1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Component                                                        */
16 /**                                                                       */
17 /**   Internet Group Management Protocol (IGMP)                           */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 #define NX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "nx_api.h"
28 #include "nx_ip.h"
29 #include "nx_igmp.h"
30 
31 
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _nx_ipv4_multicast_interface_join                   PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Yuxin Zhou, Microsoft Corporation                                   */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function handles the request to join the specified multicast   */
45 /*    group on a specified network device.  This function notifies the    */
46 /*    IP layer to receive on the multicast group address.  However it     */
47 /*    does not invoke IGMP group membership report messages.              */
48 /*                                                                        */
49 /*  INPUT                                                                 */
50 /*                                                                        */
51 /*    ip_ptr                                IP instance pointer           */
52 /*    group_address                         Multicast group to join       */
53 /*    interface_index                       Index to the interface        */
54 /*                                                                        */
55 /*  OUTPUT                                                                */
56 /*                                                                        */
57 /*    status                                Completion status             */
58 /*                                                                        */
59 /*  CALLS                                                                 */
60 /*                                                                        */
61 /*    _nx_igmp_multicast_interface_join_internal                          */
62 /*                                                                        */
63 /*  CALLED BY                                                             */
64 /*                                                                        */
65 /*    Application Code                                                    */
66 /*                                                                        */
67 /*  RELEASE HISTORY                                                       */
68 /*                                                                        */
69 /*    DATE              NAME                      DESCRIPTION             */
70 /*                                                                        */
71 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
72 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
73 /*                                            resulting in version 6.1    */
74 /*                                                                        */
75 /**************************************************************************/
_nx_ipv4_multicast_interface_join(NX_IP * ip_ptr,ULONG group_address,UINT interface_index)76 UINT  _nx_ipv4_multicast_interface_join(NX_IP *ip_ptr, ULONG group_address, UINT interface_index)
77 {
78 
79 #ifndef NX_DISABLE_IPV4
80     return(_nx_igmp_multicast_interface_join_internal(ip_ptr, group_address, interface_index, NX_WAIT_FOREVER));
81 #else /* NX_DISABLE_IPV4  */
82     NX_PARAMETER_NOT_USED(ip_ptr);
83     NX_PARAMETER_NOT_USED(group_address);
84     NX_PARAMETER_NOT_USED(interface_index);
85 
86     return(NX_NOT_SUPPORTED);
87 #endif /* !NX_DISABLE_IPV4  */
88 }
89 
90