mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-23 20:31:59 +00:00
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
Signed-off-by: John Crispin <john@phrozen.org>
79 lines
2.5 KiB
C
79 lines
2.5 KiB
C
/*
|
|
* trustsec.h
|
|
* trustsec header definition
|
|
*
|
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
#ifndef _LINUX_IF_TRUSTSEC_H_
|
|
#define _LINUX_IF_TRUSTSEC_H_
|
|
|
|
#define TRUSTSEC_HLEN 6 /* The additional bytes required by trustsec header. */
|
|
#define ETH_P_TRSEC 0x8909 /* Protocol number for trustsec header. */
|
|
|
|
#define TRUSTSEC_META_HDR_VERSION 0x1 /* Meta header version number. */
|
|
#define TRUSTSEC_META_HDR_LEN 0x1 /* trustsec meta header length. */
|
|
#define TRUSTSEC_PAYLOAD_LEN 0x0 /* Length of the payload. */
|
|
#define TRUSTSEC_PAYLOAD_OPT_TYPE 0x0001 /* Option type field. */
|
|
|
|
/*
|
|
* trustsec_hdr
|
|
* Defines trustsec header
|
|
*/
|
|
struct trustsec_hdr {
|
|
u8 meta_hdr_ver;
|
|
u8 meta_hdr_len;
|
|
#if defined(__BIG_ENDIAN_BITFIELD)
|
|
u16 payload_len:3;
|
|
u16 payload_opt_type :13;
|
|
#else
|
|
u16 payload_opt_type :13;
|
|
u16 payload_len:3;
|
|
#endif
|
|
__be16 sgt;
|
|
};
|
|
|
|
static inline struct trustsec_hdr *trustsec_get_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct trustsec_hdr *)skb_network_header(skb);
|
|
}
|
|
|
|
|
|
/**
|
|
* trustsec_insert_hdr - insert trustsec header
|
|
* @skb: skbuff to insert header
|
|
* @sgt: SGT value
|
|
*
|
|
* Inserts the trustsec header into @skb as part of the payload
|
|
* Returns a trustsec encapsulated skb.
|
|
*
|
|
* Updates skb->protocol to trustsec protocol number
|
|
* Caller must guarantee that the given SKB has enough headroom
|
|
*/
|
|
static inline void trustsec_insert_hdr(struct sk_buff *skb, __be16 sgt)
|
|
{
|
|
struct trustsec_hdr *thdr;
|
|
|
|
thdr = (struct trustsec_hdr *)skb_push(skb, TRUSTSEC_HLEN);
|
|
thdr->meta_hdr_ver = TRUSTSEC_META_HDR_VERSION;
|
|
thdr->meta_hdr_len = TRUSTSEC_META_HDR_LEN;
|
|
thdr->payload_len = htons(TRUSTSEC_PAYLOAD_LEN);
|
|
thdr->payload_opt_type = htons(TRUSTSEC_PAYLOAD_OPT_TYPE);
|
|
thdr->sgt = sgt;
|
|
skb->protocol = htons(ETH_P_TRSEC);
|
|
}
|
|
|
|
#endif /* !(_LINUX_IF_TRUSTSEC_H_) */
|