From: Roy Marples Date: Thu, 12 Feb 2009 10:07:30 +0000 (+0000) Subject: Fix up some more formatting. X-Git-Tag: v5.0.0~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35456091989ef70c3b5285d2c27867bc578639f3;p=thirdparty%2Fdhcpcd.git Fix up some more formatting. --- diff --git a/dhcpcd.h b/dhcpcd.h index 7c33b22c..83440691 100644 --- 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 cc473385..b3c30cc3 100644 --- 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 *); diff --git a/if-linux.c b/if-linux.c index 3e2f9077..c46be587 100644 --- a/if-linux.c +++ b/if-linux.c @@ -42,14 +42,6 @@ #include #include -# 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 - #include #include #include diff --git a/lpf.c b/lpf.c index 674d9767..550277ef 100644 --- a/lpf.c +++ b/lpf.c @@ -1,6 +1,6 @@ /* * dhcpcd - DHCP client daemon - * Copyright 2006-2008 Roy Marples + * Copyright 2006-2009 Roy Marples * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ # include /* needed for 2.4 kernels for the below header */ # include # include -# 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 a8ede771..b6ee44dd 100644 --- 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 diff --git a/signals.c b/signals.c index f96a25ac..0007b5d2 100644 --- 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