summary refs log tree commit diff
path: root/shared/n-dhcp4/src/util/packet.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
committerMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
commite74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch)
tree3469f17ea9af91f7ff169b890633bda68b0cf76e /shared/n-dhcp4/src/util/packet.h
parentbfe522304da217296e2a61040f58e35ec5d6f3f2 (diff)
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'shared/n-dhcp4/src/util/packet.h')
-rw-r--r--shared/n-dhcp4/src/util/packet.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/shared/n-dhcp4/src/util/packet.h b/shared/n-dhcp4/src/util/packet.h
deleted file mode 100644
index 98dabf7f..00000000
--- a/shared/n-dhcp4/src/util/packet.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#pragma once
-
-/*
- * Packet Sockets
- */
-
-#include <c-stdaux.h>
-#include <inttypes.h>
-#include <linux/if_packet.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/*
- * `struct sockaddr_ll` is too small to fit the Infiniband hardware address.
- * Introduce `struct packet_sockaddr_ll` which is the same as the original,
- * except the `sl_addr` field is extended to fit all the supported hardware
- * addresses.
- */
-struct packet_sockaddr_ll {
-        unsigned short  sll_family;
-        __be16          sll_protocol;
-        int             sll_ifindex;
-        unsigned short  sll_hatype;
-        unsigned char   sll_pkttype;
-        unsigned char   sll_halen;
-        unsigned char   sll_addr[32]; /* MAX_ADDR_LEN */
-};
-
-uint16_t packet_internet_checksum(const uint8_t *data, size_t len);
-uint16_t packet_internet_checksum_udp(const struct in_addr *src_addr,
-                                      const struct in_addr *dst_addr,
-                                      uint16_t src_port,
-                                      uint16_t dst_port,
-                                      const uint8_t *data,
-                                      size_t size,
-                                      uint16_t checksum);
-
-int packet_sendto_udp(int sockfd,
-                      const void *buf,
-                      size_t n_buf,
-                      size_t *n_transmittedp,
-                      const struct sockaddr_in *src_paddr,
-                      const struct packet_sockaddr_ll *dest_haddr,
-                      const struct sockaddr_in *dest_paddr);
-int packet_recvfrom_udp(int sockfd,
-                        void *buf,
-                        size_t n_buf,
-                        size_t *n_transmittedp,
-                        struct sockaddr_in *src);
-
-int packet_shutdown(int sockfd);
-
-/* inline helpers */
-
-static inline int packet_recv_udp(int sockfd,
-                                  void *buf,
-                                  size_t n_buf,
-                                  size_t *n_transmittedp) {
-        return packet_recvfrom_udp(sockfd, buf, n_buf, n_transmittedp, NULL);
-}