162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _TRANSP_V6_H
362306a36Sopenharmony_ci#define _TRANSP_V6_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <net/checksum.h>
662306a36Sopenharmony_ci#include <net/sock.h>
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* IPv6 transport protocols */
962306a36Sopenharmony_ciextern struct proto rawv6_prot;
1062306a36Sopenharmony_ciextern struct proto udpv6_prot;
1162306a36Sopenharmony_ciextern struct proto udplitev6_prot;
1262306a36Sopenharmony_ciextern struct proto tcpv6_prot;
1362306a36Sopenharmony_ciextern struct proto pingv6_prot;
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cistruct flowi6;
1662306a36Sopenharmony_cistruct ipcm6_cookie;
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/* extension headers */
1962306a36Sopenharmony_ciint ipv6_exthdrs_init(void);
2062306a36Sopenharmony_civoid ipv6_exthdrs_exit(void);
2162306a36Sopenharmony_ciint ipv6_frag_init(void);
2262306a36Sopenharmony_civoid ipv6_frag_exit(void);
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci/* transport protocols */
2562306a36Sopenharmony_ciint pingv6_init(void);
2662306a36Sopenharmony_civoid pingv6_exit(void);
2762306a36Sopenharmony_ciint rawv6_init(void);
2862306a36Sopenharmony_civoid rawv6_exit(void);
2962306a36Sopenharmony_ciint udpv6_init(void);
3062306a36Sopenharmony_civoid udpv6_exit(void);
3162306a36Sopenharmony_ciint udplitev6_init(void);
3262306a36Sopenharmony_civoid udplitev6_exit(void);
3362306a36Sopenharmony_ciint tcpv6_init(void);
3462306a36Sopenharmony_civoid tcpv6_exit(void);
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci/* this does all the common and the specific ctl work */
3762306a36Sopenharmony_civoid ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
3862306a36Sopenharmony_ci			   struct sk_buff *skb);
3962306a36Sopenharmony_civoid ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
4062306a36Sopenharmony_ci				  struct sk_buff *skb);
4162306a36Sopenharmony_civoid ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
4262306a36Sopenharmony_ci				    struct sk_buff *skb);
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciint ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
4562306a36Sopenharmony_ci			  struct flowi6 *fl6, struct ipcm6_cookie *ipc6);
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_civoid __ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
4862306a36Sopenharmony_ci			       __u16 srcp, __u16 destp, int rqueue, int bucket);
4962306a36Sopenharmony_cistatic inline void
5062306a36Sopenharmony_ciip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp, __u16 srcp,
5162306a36Sopenharmony_ci			__u16 destp, int bucket)
5262306a36Sopenharmony_ci{
5362306a36Sopenharmony_ci	__ip6_dgram_sock_seq_show(seq, sp, srcp, destp, sk_rmem_alloc_get(sp),
5462306a36Sopenharmony_ci				  bucket);
5562306a36Sopenharmony_ci}
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define IPV6_SEQ_DGRAM_HEADER					       \
6062306a36Sopenharmony_ci	"  sl  "						       \
6162306a36Sopenharmony_ci	"local_address                         "		       \
6262306a36Sopenharmony_ci	"remote_address                        "		       \
6362306a36Sopenharmony_ci	"st tx_queue rx_queue tr tm->when retrnsmt"		       \
6462306a36Sopenharmony_ci	"   uid  timeout inode ref pointer drops\n"
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#endif
67