326 lines
9.5 KiB
C
326 lines
9.5 KiB
C
/* ipmip_inet6.h - ipmip_inet6.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip_inet6.h,v $ $Revision: 1.5 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmip/include/private/ipmip_inet6.h,v $
|
|
* $Author: jhorteli $ $Date: 2010-12-07 09:55:01 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIP_INET6_H
|
|
#define IPMIP_INET6_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
DESCRIPTION
|
|
|
|
INET6 address domain specific utility functions and routines. This module
|
|
provides routines for joining/leaving multicast/anycast groups and receiving
|
|
UDP frames.
|
|
|
|
EXAMPLE
|
|
|
|
This example shows how to join/leave multicast or anycast addresses.
|
|
|
|
.CS
|
|
|
|
#define IPMIP_IP6_SET_ALL_NODES_ADDR(addr) do { \
|
|
IP_SET_HTONL(&(addr)->in6.addr32[0], 0xff020000); \
|
|
IP_SET_32ON16(&(addr)->in6.addr32[1], 0); \
|
|
IP_SET_32ON16(&(addr)->in6.addr32[2], 0); \
|
|
IP_SET_HTONL(&(addr)->in6.addr32[3], 0x00000001); \
|
|
} while(0)
|
|
|
|
void my_init_function(struct Ipmip_my_context *ctx, Ipmip_proc_t *proc, int ifindex, int fd)
|
|
{
|
|
struct Ip_in6_addr mcast;
|
|
|
|
/@ Create the all nodes multicast address @/
|
|
IPMIP_IP6_SET_ALL_NODES_ADDR(&mcast);
|
|
|
|
/@ Join the all nodes multicast address @/
|
|
ipmip_inet6_multicast_join(&ctx->ipmip, proc, fd, ifindex, &mcast);
|
|
|
|
/@ Leave the all nodes multicast address @/
|
|
ipmip_inet6_multicast_leave(&ctx->ipmip, proc, fd, ifindex, &mcast);
|
|
}
|
|
|
|
.CE
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef IPMIP_USE_INET6
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmip_pktbuf;
|
|
struct Ipmip_context;
|
|
struct Ipmip_proc;
|
|
struct Ip_in6_addr;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip_inet6_udp_recvmsg - ipmip_inet6_udp_recvmsg
|
|
*
|
|
* Receive an INET6 UDP message from an IP_IPPROTO_UDP socket. This method
|
|
* will also resolve the packet information (receiving interface, destination
|
|
* address)
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip_context_create(). See ipmip_context.h for more information
|
|
* regarding the mobility entity context singleton.
|
|
* \i proc
|
|
* The process context associated with the currently executing thread. Each
|
|
* thread and/or process in MIP must have its own unique process context.
|
|
* If a process is started using ipmip_proc_start, the process context will
|
|
* be allocated automatically by the IPMIP framework. Otherwise it must
|
|
* be allocated using ipmip_proc_alloc().
|
|
* \i vlen
|
|
* Buffer size
|
|
* \i fd
|
|
* File descriptor
|
|
* \ie
|
|
*
|
|
* RETURNS: The packet buffer on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL struct Ipmip_pktbuf *ipmip_inet6_udp_recvmsg
|
|
(
|
|
struct Ipmip_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ip_size_t vlen,
|
|
Ip_fd fd
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip_inet6_multicast_join - ipmip_inet6_multicast_join
|
|
*
|
|
* Join a multicast group
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip_context_create(). See ipmip_context.h for more information
|
|
* regarding the mobility entity context singleton.
|
|
* \i proc
|
|
* The process context associated with the currently executing thread. Each
|
|
* thread and/or process in MIP must have its own unique process context.
|
|
* If a process is started using ipmip_proc_start, the process context will
|
|
* be allocated automatically by the IPMIP framework. Otherwise it must
|
|
* be allocated using ipmip_proc_alloc().
|
|
* \i fd
|
|
* File Descriptor
|
|
* \i ifindex
|
|
* Interface index
|
|
* \i mcast
|
|
* Multicast Group
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip_inet6_multicast_join
|
|
(
|
|
struct Ipmip_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ip_fd fd,
|
|
Ip_u32 ifindex,
|
|
struct Ip_in6_addr *mcast
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip_inet6_multicast_leave - ipmip_inet6_multicast_leave
|
|
*
|
|
* Join a multicast group
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip_context_create(). See ipmip_context.h for more information
|
|
* regarding the mobility entity context singleton.
|
|
* \i proc
|
|
* The process context associated with the currently executing thread. Each
|
|
* thread and/or process in MIP must have its own unique process context.
|
|
* If a process is started using ipmip_proc_start, the process context will
|
|
* be allocated automatically by the IPMIP framework. Otherwise it must
|
|
* be allocated using ipmip_proc_alloc().
|
|
* \i fd
|
|
* File Descriptor
|
|
* \i ifindex
|
|
* Interface index
|
|
* \i mcast
|
|
* Multicast Group
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip_inet6_multicast_leave
|
|
(
|
|
struct Ipmip_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ip_fd fd,
|
|
Ip_u32 ifindex,
|
|
struct Ip_in6_addr *mcast
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip_inet6_anycast_join - ipmip_inet6_anycast_join
|
|
*
|
|
* Join a anycast address
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip_context_create(). See ipmip_context.h for more information
|
|
* regarding the mobility entity context singleton.
|
|
* \i proc
|
|
* The process context associated with the currently executing thread. Each
|
|
* thread and/or process in MIP must have its own unique process context.
|
|
* If a process is started using ipmip_proc_start, the process context will
|
|
* be allocated automatically by the IPMIP framework. Otherwise it must
|
|
* be allocated using ipmip_proc_alloc().
|
|
* \i fd
|
|
* File Descriptor
|
|
* \i ifindex
|
|
* Interface index
|
|
* \i anycast
|
|
* Anycast address
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip_inet6_anycast_join
|
|
(
|
|
struct Ipmip_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ip_fd fd,
|
|
Ip_u32 ifindex,
|
|
struct Ip_in6_addr *anycast
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip_inet6_anycast_leave - ipmip_inet6_anycast_leave
|
|
*
|
|
* Join a multicast group
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip_context_create(). See ipmip_context.h for more information
|
|
* regarding the mobility entity context singleton.
|
|
* \i proc
|
|
* The process context associated with the currently executing thread. Each
|
|
* thread and/or process in MIP must have its own unique process context.
|
|
* If a process is started using ipmip_proc_start, the process context will
|
|
* be allocated automatically by the IPMIP framework. Otherwise it must
|
|
* be allocated using ipmip_proc_alloc().
|
|
* \i fd
|
|
* File Descriptor
|
|
* \i ifindex
|
|
* Interface index
|
|
* \i anycast
|
|
* Anycast address
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip_inet6_anycast_leave
|
|
(
|
|
struct Ipmip_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ip_fd fd,
|
|
Ip_u32 ifindex,
|
|
struct Ip_in6_addr *anycast
|
|
);
|
|
|
|
|
|
#endif /* IPMIP_USE_INET6 */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|