History

bpf: sync tools bpf.h uapi header

Only sync the header from include/uapi/linux/bpf.h.

Daniel Borkmann committed 8 years ago

Commit 32b36521 parent 24dea041 file · +32 −1Browse files

Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+32−1
@@ -1801,6 +1801,30 @@ union bpf_attr { · 1800 unmodified lines
1801 * Return1801 * Return
1802 * a non-negative value equal to or less than size on success, or1802 * a non-negative value equal to or less than size on success, or
1803 * a negative error in case of failure.1803 * a negative error in case of failure.
1804 *
1805 * int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header)
1806 * Description
1807 * This helper is similar to **bpf_skb_load_bytes**\ () in that
1808 * it provides an easy way to load *len* bytes from *offset*
1809 * from the packet associated to *skb*, into the buffer pointed
1810 * by *to*. The difference to **bpf_skb_load_bytes**\ () is that
1811 * a fifth argument *start_header* exists in order to select a
1812 * base offset to start from. *start_header* can be one of:
1813 *
1814 * **BPF_HDR_START_MAC**
1815 * Base offset to load data from is *skb*'s mac header.
1816 * **BPF_HDR_START_NET**
1817 * Base offset to load data from is *skb*'s network header.
1818 *
1819 * In general, "direct packet access" is the preferred method to
1820 * access packet data, however, this helper is in particular useful
1821 * in socket filters where *skb*\ **->data** does not always point
1822 * to the start of the mac header and where "direct packet access"
1823 * is not available.
1824 *
1825 * Return
1826 * 0 on success, or a negative error in case of failure.
1827 *
1804 */1828 */
1805#define __BPF_FUNC_MAPPER(FN) \1829#define __BPF_FUNC_MAPPER(FN) \
1806 FN(unspec), \1830 FN(unspec), \
@@ -1870,7 +1894,8 @@ union bpf_attr { · 63 unmodified lines
1870 FN(bind), \1894 FN(bind), \
1871 FN(xdp_adjust_tail), \1895 FN(xdp_adjust_tail), \
1872 FN(skb_get_xfrm_state), \1896 FN(skb_get_xfrm_state), \
1873 FN(get_stack),1897 FN(get_stack), \
1898 FN(skb_load_bytes_relative),
1874 1899
1875/* integer value in 'imm' field of BPF_CALL instruction selects which helper1900/* integer value in 'imm' field of BPF_CALL instruction selects which helper
1876 * function eBPF program intends to call1901 * function eBPF program intends to call
@@ -1931,6 +1956,12 @@ enum bpf_adj_room_mode { · 54 unmodified lines
1931 BPF_ADJ_ROOM_NET,1956 BPF_ADJ_ROOM_NET,
1932};1957};
1933 1958
1959/* Mode for BPF_FUNC_skb_load_bytes_relative helper. */
1960enum bpf_hdr_start_off {
1961 BPF_HDR_START_MAC,
1962 BPF_HDR_START_NET,
1963};
1964
1934/* user accessible mirror of in-kernel sk_buff.1965/* user accessible mirror of in-kernel sk_buff.
1935 * new fields can only be added to the end of this structure1966 * new fields can only be added to the end of this structure
1936 */1967 */