Switch kernel header parsing to python libclang
Replace the tokenizer in cpp.py with libclang.
Bug: 18937958
Change-Id: I27630904c6d2849418cd5ca3d3c612ec3078686d
diff --git a/libc/kernel/uapi/linux/if_bridge.h b/libc/kernel/uapi/linux/if_bridge.h
index b4c3b59..1394b6f 100644
--- a/libc/kernel/uapi/linux/if_bridge.h
+++ b/libc/kernel/uapi/linux/if_bridge.h
@@ -61,59 +61,59 @@
#define BR_STATE_BLOCKING 4
struct __bridge_info {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u64 designated_root;
- __u64 bridge_id;
- __u32 root_path_cost;
- __u32 max_age;
+ __u64 designated_root;
+ __u64 bridge_id;
+ __u32 root_path_cost;
+ __u32 max_age;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 hello_time;
- __u32 forward_delay;
- __u32 bridge_max_age;
- __u32 bridge_hello_time;
+ __u32 hello_time;
+ __u32 forward_delay;
+ __u32 bridge_max_age;
+ __u32 bridge_hello_time;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 bridge_forward_delay;
- __u8 topology_change;
- __u8 topology_change_detected;
- __u8 root_port;
+ __u32 bridge_forward_delay;
+ __u8 topology_change;
+ __u8 topology_change_detected;
+ __u8 root_port;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 stp_enabled;
- __u32 ageing_time;
- __u32 gc_interval;
- __u32 hello_timer_value;
+ __u8 stp_enabled;
+ __u32 ageing_time;
+ __u32 gc_interval;
+ __u32 hello_timer_value;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 tcn_timer_value;
- __u32 topology_change_timer_value;
- __u32 gc_timer_value;
+ __u32 tcn_timer_value;
+ __u32 topology_change_timer_value;
+ __u32 gc_timer_value;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct __port_info {
- __u64 designated_root;
- __u64 designated_bridge;
- __u16 port_id;
+ __u64 designated_root;
+ __u64 designated_bridge;
+ __u16 port_id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u16 designated_port;
- __u32 path_cost;
- __u32 designated_cost;
- __u8 state;
+ __u16 designated_port;
+ __u32 path_cost;
+ __u32 designated_cost;
+ __u8 state;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 top_change_ack;
- __u8 config_pending;
- __u8 unused0;
- __u32 message_age_timer_value;
+ __u8 top_change_ack;
+ __u8 config_pending;
+ __u8 unused0;
+ __u32 message_age_timer_value;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 forward_delay_timer_value;
- __u32 hold_timer_value;
+ __u32 forward_delay_timer_value;
+ __u32 hold_timer_value;
};
struct __fdb_entry {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 mac_addr[ETH_ALEN];
- __u8 port_no;
- __u8 is_local;
- __u32 ageing_timer_value;
+ __u8 mac_addr[ETH_ALEN];
+ __u8 port_no;
+ __u8 is_local;
+ __u32 ageing_timer_value;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 port_hi;
- __u8 pad0;
- __u16 unused;
+ __u8 port_hi;
+ __u8 pad0;
+ __u16 unused;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BRIDGE_FLAGS_MASTER 1
@@ -122,79 +122,79 @@
#define BRIDGE_MODE_VEPA 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
- IFLA_BRIDGE_FLAGS,
- IFLA_BRIDGE_MODE,
- IFLA_BRIDGE_VLAN_INFO,
+ IFLA_BRIDGE_FLAGS,
+ IFLA_BRIDGE_MODE,
+ IFLA_BRIDGE_VLAN_INFO,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __IFLA_BRIDGE_MAX,
+ __IFLA_BRIDGE_MAX,
};
#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
-#define BRIDGE_VLAN_INFO_MASTER (1<<0)
+#define BRIDGE_VLAN_INFO_MASTER (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define BRIDGE_VLAN_INFO_PVID (1<<1)
-#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2)
+#define BRIDGE_VLAN_INFO_PVID (1 << 1)
+#define BRIDGE_VLAN_INFO_UNTAGGED (1 << 2)
struct bridge_vlan_info {
- __u16 flags;
+ __u16 flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u16 vid;
+ __u16 vid;
};
enum {
- MDBA_UNSPEC,
+ MDBA_UNSPEC,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- MDBA_MDB,
- MDBA_ROUTER,
- __MDBA_MAX,
+ MDBA_MDB,
+ MDBA_ROUTER,
+ __MDBA_MAX,
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MDBA_MAX (__MDBA_MAX - 1)
enum {
- MDBA_MDB_UNSPEC,
- MDBA_MDB_ENTRY,
+ MDBA_MDB_UNSPEC,
+ MDBA_MDB_ENTRY,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __MDBA_MDB_MAX,
+ __MDBA_MDB_MAX,
};
#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- MDBA_MDB_ENTRY_UNSPEC,
- MDBA_MDB_ENTRY_INFO,
- __MDBA_MDB_ENTRY_MAX,
+ MDBA_MDB_ENTRY_UNSPEC,
+ MDBA_MDB_ENTRY_INFO,
+ __MDBA_MDB_ENTRY_MAX,
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
enum {
- MDBA_ROUTER_UNSPEC,
- MDBA_ROUTER_PORT,
+ MDBA_ROUTER_UNSPEC,
+ MDBA_ROUTER_PORT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __MDBA_ROUTER_MAX,
+ __MDBA_ROUTER_MAX,
};
#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
struct br_port_msg {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 family;
- __u32 ifindex;
+ __u8 family;
+ __u32 ifindex;
};
struct br_mdb_entry {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 ifindex;
+ __u32 ifindex;
#define MDB_TEMPORARY 0
#define MDB_PERMANENT 1
- __u8 state;
+ __u8 state;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- struct {
- union {
- __be32 ip4;
- struct in6_addr ip6;
+ struct {
+ union {
+ __be32 ip4;
+ struct in6_addr ip6;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- } u;
- __be16 proto;
- } addr;
+ } u;
+ __be16 proto;
+ } addr;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
- MDBA_SET_ENTRY_UNSPEC,
- MDBA_SET_ENTRY,
- __MDBA_SET_ENTRY_MAX,
+ MDBA_SET_ENTRY_UNSPEC,
+ MDBA_SET_ENTRY,
+ __MDBA_SET_ENTRY_MAX,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)