]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix up some more formatting.
authorRoy Marples <roy@marples.name>
Thu, 12 Feb 2009 10:07:30 +0000 (10:07 +0000)
committerRoy Marples <roy@marples.name>
Thu, 12 Feb 2009 10:07:30 +0000 (10:07 +0000)
dhcpcd.h
dhcpf.h
if-linux.c
lpf.c
net.h
signals.c

index 7c33b22cc03fe6a229a8e94e8c815f86a7047d35..834406913294b0368bc269edfb0148c140e03a3f 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -77,8 +77,7 @@ struct if_state {
        struct in_addr fail;
 };
 
-struct interface
-{
+struct interface {
        char name[IF_NAMESIZE];
        struct if_state *state;
 
diff --git a/dhcpf.h b/dhcpf.h
index cc47338590f70b0afba6c6e19d83a947c62a2677..b3c30cc3124718430c8c833d153698948dc92f09 100644 (file)
--- a/dhcpf.h
+++ b/dhcpf.h
@@ -49,7 +49,8 @@ struct rt *get_option_routes(const struct dhcp_message *);
 ssize_t configure_env(char **, const char *, const struct dhcp_message *,
     const struct if_options *);
 
-ssize_t make_message(struct dhcp_message **, const struct interface *, uint8_t);
+ssize_t make_message(struct dhcp_message **, const struct interface *,
+    uint8_t);
 int valid_dhcp_packet(unsigned char *);
 
 ssize_t write_lease(const struct interface *, const struct dhcp_message *);
index 3e2f9077687088bfc5a909c403c213e535f96dbe..c46be587035d1a5b85edf14d3ee8f2b0da347235 100644 (file)
 #include <linux/rtnetlink.h>
 #include <linux/wireless.h>
 
-# define SIOCGIWNAME 0x8B01
-/* FIXME: Some linux kernel verisons DO NOT like this include
- * They have the error:
- * /usr/include/linux/if.h:92: error: redefinition of `struct ifmap'
- * We work around this by defining the above ioctl and using an ifreq
- * structure which seems to work fine. */
-//# include <linux/wireless.h>
-
 #include <errno.h>
 #include <ctype.h>
 #include <fnmatch.h>
diff --git a/lpf.c b/lpf.c
index 674d9767a2dba13044293d781462dfd8152e489e..550277ef147741c77ab98773bc71d10b36f23048 100644 (file)
--- a/lpf.c
+++ b/lpf.c
@@ -1,6 +1,6 @@
 /*
  * dhcpcd - DHCP client daemon
- * Copyright 2006-2008 Roy Marples <roy@marples.name>
+ * Copyright 2006-2009 Roy Marples <roy@marples.name>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
 # include <asm/types.h> /* needed for 2.4 kernels for the below header */
 # include <linux/filter.h>
 # include <netpacket/packet.h>
-# define bpf_insn sock_filter
+# define bpf_insn              sock_filter
 # define BPF_SKIPTYPE
 # define BPF_ETHCOOK           -ETH_HLEN
 # define BPF_WHOLEPACKET       0x0fffffff /* work around buggy LPF filters */
@@ -60,8 +60,8 @@
 /* Broadcast address for IPoIB */
 static const uint8_t ipv4_bcast_addr[] = {
        0x00, 0xff, 0xff, 0xff,
-               0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
-               0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
+       0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
 };
 
 int
diff --git a/net.h b/net.h
index a8ede771a13a1656032b5909d436f5c83e598305..b6ee44dda7df1e701da9fff463aaae5de2bfa8fb 100644 (file)
--- a/net.h
+++ b/net.h
@@ -66,9 +66,9 @@
  * 192.168/16
  */
 #ifndef IN_PRIVATE
-# define IN_PRIVATE(addr) (((addr & IN_CLASSA_NET) == 0x0a000000) || \
-                          ((addr & 0xfff00000)    == 0xac100000) || \
-                          ((addr & IN_CLASSB_NET) == 0xc0a80000))
+# define IN_PRIVATE(addr) (((addr & IN_CLASSA_NET) == 0x0a000000) ||   \
+           ((addr & 0xfff00000)    == 0xac100000) ||                   \
+           ((addr & IN_CLASSB_NET) == 0xc0a80000))
 #endif
 
 #define LINKLOCAL_ADDR 0xa9fe0000
@@ -103,30 +103,31 @@ int inet_ntocidr(struct in_addr);
 int inet_cidrtoaddr(int, struct in_addr *);
 
 int up_interface(const char *);
-int do_interface(const char *, void (*)(struct interface **, int, char * const *, struct ifreq *),
-                struct interface **, int, char * const *,
-                struct in_addr *, struct in_addr *, int);
+int do_interface(const char *,
+    void (*)(struct interface **, int, char * const *, struct ifreq *),
+    struct interface **, int, char * const *,
+    struct in_addr *, struct in_addr *, int);
 int if_address(const struct interface *,
-              const struct in_addr *, const struct in_addr *,
-              const struct in_addr *, int);
-#define add_address(iface, addr, net, brd) \
+    const struct in_addr *, const struct in_addr *,
+    const struct in_addr *, int);
+#define add_address(iface, addr, net, brd)                             \
        if_address(iface, addr, net, brd, 1)
-#define del_address(iface, addr, net) \
+#define del_address(iface, addr, net)                                  \
        if_address(iface, addr, net, NULL, -1)
-#define has_address(iface, addr, net) \
+#define has_address(iface, addr, net)                                  \
        do_interface(iface, NULL, NULL, 0, NULL, addr, net, 0)
-#define get_address(iface, addr, net) \
+#define get_address(iface, addr, net)                                  \
        do_interface(iface, NULL, NULL, 0, NULL, addr, net, 1)
 
 int if_route(const struct interface *, const struct in_addr *,
-            const struct in_addr *, const struct in_addr *, int, int);
-#define add_route(iface, dest, mask, gate, metric) \
+    const struct in_addr *, const struct in_addr *, int, int);
+#define add_route(iface, dest, mask, gate, metric)                     \
        if_route(iface, dest, mask, gate, metric, 1)
-#define change_route(iface, dest, mask, gate, metric) \
+#define change_route(iface, dest, mask, gate, metric)                  \
        if_route(iface, dest, mask, gate, metric, 0)
-#define del_route(iface, dest, mask, gate, metric) \
+#define del_route(iface, dest, mask, gate, metric)                     \
        if_route(iface, dest, mask, gate, metric, -1)
-#define del_src_route(iface, dest, mask, gate, metric) \
+#define del_src_route(iface, dest, mask, gate, metric)                 \
        if_route(iface, dest, mask, gate, metric, -2)
 int arp_flush(void);
 void free_routes(struct rt *);
@@ -134,22 +135,22 @@ void free_routes(struct rt *);
 int open_udp_socket(struct interface *);
 const size_t udp_dhcp_len;
 ssize_t make_udp_packet(uint8_t **, const uint8_t *, size_t,
-                       struct in_addr, struct in_addr);
+    struct in_addr, struct in_addr);
 ssize_t get_udp_data(const uint8_t **, const uint8_t *);
 int valid_udp_packet(const uint8_t *);
 
 int open_socket(struct interface *, int);
 ssize_t send_packet(const struct interface *, struct in_addr, 
-                   const uint8_t *, ssize_t);
+    const uint8_t *, ssize_t);
 ssize_t send_raw_packet(const struct interface *, int,
-                       const void *, ssize_t);
+    const void *, ssize_t);
 ssize_t get_raw_packet(struct interface *, int, void *, ssize_t);
 
 int init_socket(void);
 int open_link_socket(void);
 int manage_link(int,
-               void (*)(const char *),
-               void (*)(const char *),
-               void (*)(const char *));
+    void (*)(const char *),
+    void (*)(const char *),
+    void (*)(const char *));
 int carrier_status(const char *);
 #endif
index f96a25ac17c3fb38d0b30a85c4bf8cfcc5cfef30..0007b5d25c3f5f8142dfa2e807bb9b7daf6f57b7 100644 (file)
--- a/signals.c
+++ b/signals.c
@@ -41,10 +41,10 @@ static int signal_pipe[2];
 
 static const int handle_sigs[] = {
        SIGALRM,
-               SIGHUP,
-               SIGINT,
-               SIGPIPE,
-               SIGTERM
+       SIGHUP,
+       SIGINT,
+       SIGPIPE,
+       SIGTERM
 };
 
 static void