Skip to content

Commit 88d62a1

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
if: add net device type
adapts to third-party code compilation. in the process of porting ConnMan, we encounter some situations where the structure is not defined, or the returned data types do not match the expectations. Refer to the common implementation of other systems and add relevant definitions. Signed-off-by: zhanghongyu <[email protected]>
1 parent 89eb417 commit 88d62a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/net/if.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
#define IFF_POINTOPOINT (1 << 6) /* Is point-to-point link */
5555
#define IFF_NOARP (1 << 7) /* ARP is not required for this packet */
5656
#define IFF_NAT (1 << 8) /* NAT is enabled for this interface */
57+
#define IFF_SLAVE (1 << 11) /* Slave of a load balancer. */
5758
#define IFF_MULTICAST (1 << 12) /* Supports multicast. */
5859
#define IFF_BROADCAST (1 << 13) /* Broadcast address valid. */
60+
#define IFF_DYNAMIC (1 << 15) /* Dialup device with changing addresses. */
5961

6062
/* Interface flag helpers */
6163

@@ -67,6 +69,8 @@
6769
#define IFF_SET_POINTOPOINT(f) do { (f) |= IFF_POINTOPOINT; } while (0)
6870
#define IFF_SET_MULTICAST(f) do { (f) |= IFF_MULTICAST; } while (0)
6971
#define IFF_SET_BROADCAST(f) do { (f) |= IFF_BROADCAST; } while (0)
72+
#define IFF_SET_SLAVE(f) do { (f) |= IFF_SLAVE; } while (0)
73+
#define IFF_SET_DYNAMIC(f) do { (f) |= IFF_DYNAMIC; } while (0)
7074

7175
#define IFF_CLR_UP(f) do { (f) &= ~IFF_UP; } while (0)
7276
#define IFF_CLR_RUNNING(f) do { (f) &= ~IFF_RUNNING; } while (0)
@@ -76,6 +80,8 @@
7680
#define IFF_CLR_POINTOPOINT(f) do { (f) &= ~IFF_POINTOPOINT; } while (0)
7781
#define IFF_CLR_MULTICAST(f) do { (f) &= ~IFF_MULTICAST; } while (0)
7882
#define IFF_CLR_BROADCAST(f) do { (f) &= ~IFF_BROADCAST; } while (0)
83+
#define IFF_CLR_SLAVE(f) do { (f) &= ~IFF_SLAVE; } while (0)
84+
#define IFF_CLR_DYNAMIC(f) do { (f) &= ~IFF_DYNAMIC; } while (0)
7985

8086
#define IFF_IS_UP(f) (((f) & IFF_UP) != 0)
8187
#define IFF_IS_RUNNING(f) (((f) & IFF_RUNNING) != 0)
@@ -85,6 +91,8 @@
8591
#define IFF_IS_POINTOPOINT(f) (((f) & IFF_POINTOPOINT) != 0)
8692
#define IFF_IS_MULTICAST(f) (((f) & IFF_MULTICAST) != 0)
8793
#define IFF_IS_BROADCAST(f) (((f) & IFF_BROADCAST) != 0)
94+
#define IFF_IS_SLAVE(f) (((f) & IFF_SLAVE) != 0)
95+
#define IFF_IS_DYNAMIC(f) (((f) & IFF_DYNAMIC) != 0)
8896

8997
/* We only need to manage the IPv6 bit if both IPv6 and IPv4 are supported.
9098
* Otherwise, we can save a few bytes by ignoring it.

0 commit comments

Comments
 (0)