Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../../usr/include/libumac.h
Real path: /usr/include/libumac.h
Zurück
/* * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. */ #ifndef _LIBUMAC_H #define _LIBUMAC_H #include <sys/types.h> #include <sys/uio.h> #include <sys/ethernet.h> #include <netinet/in.h> #ifdef __cplusplus extern "C" { #endif typedef enum { UMAC_STATUS_OK = 0, UMAC_STATUS_BADARG, UMAC_STATUS_BADHDR, UMAC_STATUS_TOOBIG, UMAC_STATUS_NOTFOUND, UMAC_STATUS_NOTSUP, UMAC_STATUS_NOMEM, UMAC_STATUS_DENIED, UMAC_STATUS_DLERR, UMAC_STATUS_FAILED } umac_status_t; #define UMAC_STRSIZE 1024 typedef struct __umac_handle *umac_handle_t; typedef struct umac_open_args { int uo_unused; } umac_open_args_t; extern umac_status_t umac_open(const char *, umac_open_args_t *, umac_handle_t *); extern umac_status_t umac_close(umac_handle_t); #define UMAC_PKT_IPv4_w_options 0x1 #define UMAC_PKT_IPv6 0x2 #define UMAC_PKT_VLAN 0x4 typedef struct umac_tx_args { /* * pkt_options 0 mean default pkt type. * L2 without vlan, len 14 bytes. * L3 IPv4, 20 bytes, header len, checksum offload * L4 only support UDP. */ uint16_t ut_pkt_options; uint8_t ut_mac_hdr_len; uint8_t ut_ip_hdr_len; uint16_t ut_pkt_len; } umac_tx_args_t; extern umac_status_t umac_tx_vec(umac_handle_t, umac_tx_args_t *, uint8_t *, size_t, struct iovec *, int); typedef struct umac_rx_args { uint32_t ur_pkt_len; } umac_rx_args_t; extern umac_status_t umac_rx_get(umac_handle_t, umac_rx_args_t *, char **); extern umac_status_t umac_rx_put(umac_handle_t, char *); #define UMAC_FILTER_L2 0x1 #define UMAC_FILTER_FDIR 0x2 #define UMAC_FILTER_DEFAULT (UMAC_FILTER_L2 | UMAC_FILTER_FDIR) typedef struct umac_filter_args { uint32_t uf_type; uint8_t uf_macaddr[ETHERADDRL]; in6_addr_t uf_src_ip; in6_addr_t uf_dst_ip; in_port_t uf_src_port; in_port_t uf_dst_port; } umac_filter_args_t; extern umac_status_t umac_setup_rx(umac_handle_t, umac_filter_args_t *); extern int umac_handle2fd(umac_handle_t); extern uint32_t umac_handle2statid(umac_handle_t); extern const char *umac_status2str(umac_status_t, char *); extern void umac_get_mac_addr(umac_handle_t, uint8_t *); #ifdef __cplusplus } #endif #endif /* _LIBUMAC_H */