69613907f2205ae304dd3df5710f958ee4d062b9
[packages.git] / net / pepperspot / patches / 110-fix-compile.patch
1 Index: pepperspot-0.4/src/cmdline.c
2 ===================================================================
3 --- pepperspot-0.4.orig/src/cmdline.c   2010-01-16 14:25:11.000000000 +0200
4 +++ pepperspot-0.4/src/cmdline.c        2012-05-28 16:21:56.000000000 +0300
5 @@ -1335,7 +1335,7 @@
6  #endif
7  
8  int
9 -cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error)
10 +cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required __attribute__((__unused__)), const char *additional_error)
11  {
12    int c;  /* Character of the parsed option.  */
13    char *multi_token, *multi_next; /* for multiple options */
14 Index: pepperspot-0.4/src/ippool.c
15 ===================================================================
16 --- pepperspot-0.4.orig/src/ippool.c    2010-01-20 09:42:01.000000000 +0200
17 +++ pepperspot-0.4/src/ippool.c 2012-05-28 16:22:57.000000000 +0300
18 @@ -267,7 +267,7 @@
19  
20  /* Get IP address and mask */
21  int ippool_aton(struct in_addr *addr, struct in_addr *mask,
22 -                char *pool, int number)
23 +                char *pool, int number __attribute__((__unused__)))
24  {
25    /* Parse only first instance of network for now */
26    /* Eventually "number" will indicate the token which we want to parse */
27 Index: pepperspot-0.4/src/pepper.c
28 ===================================================================
29 --- pepperspot-0.4.orig/src/pepper.c    2012-05-28 16:09:54.000000000 +0300
30 +++ pepperspot-0.4/src/pepper.c 2012-05-28 16:10:39.000000000 +0300
31 @@ -3305,7 +3305,7 @@
32   * \return 0
33   * \author Sebastien Vincent
34   */
35 -static int cb_tun6_ind(struct tun6_t* tun_obj, void* pack, unsigned len)
36 +static int cb_tun6_ind(struct tun6_t* tun_obj __attribute__((__unused__)), void* pack, unsigned len)
37  {
38    struct ippoolm_t* ipm = NULL;
39    struct in6_addr dst;
40 @@ -3377,7 +3377,7 @@
41   * \param len data length
42   * \return 0
43   */
44 -int cb_tun_ind(struct tun_t *tun_obj, void *pack, unsigned len)
45 +int cb_tun_ind(struct tun_t *tun_obj __attribute__((__unused__)), void *pack, unsigned len)
46  {
47    struct ippoolm_t *ipm = NULL;
48    struct in_addr dst;
49 @@ -3459,7 +3459,7 @@
50   * \param conn redir connection that we will filled up up-to-date value
51   * \return 0 if success, -1 otherwise
52   */
53 -static int cb_redir_getstate(struct redir_t *redir_obj, struct in_addr *addr,
54 +static int cb_redir_getstate(struct redir_t *redir_obj __attribute__((__unused__)), struct in_addr *addr,
55                               struct redir_conn_t *conn)
56  {
57    struct ippoolm_t *ipm = NULL;
58 @@ -3524,7 +3524,7 @@
59   * \param conn redir connection that we will filled up up-to-date value
60   * \return 0 if success, -1 otherwise
61   */
62 -static int cb_redir_getstatev6(struct redir_t* redir_obj, struct in6_addr* addr, struct redir_conn_t* conn)
63 +static int cb_redir_getstatev6(struct redir_t* redir_obj __attribute__((__unused__)), struct in6_addr* addr, struct redir_conn_t* conn)
64  {
65    struct ippoolm_t *ipm = NULL;
66    struct app_conn_t *appconn = NULL;
67 @@ -4354,9 +4354,9 @@
68   * \param pack_req packet for request
69   * \return 0 if success, -1 otherwise
70   */
71 -int radius_conf(struct radius_t *radius_obj,
72 +int radius_conf(struct radius_t *radius_obj __attribute__((__unused__)),
73                  struct radius_packet_t *pack,
74 -                struct radius_packet_t *pack_req)
75 +                struct radius_packet_t *pack_req __attribute__((__unused__)))
76  {
77    struct radius_attr_t *attr = NULL;
78  
79 Index: pepperspot-0.4/src/tun.c
80 ===================================================================
81 --- pepperspot-0.4.orig/src/tun.c       2010-01-27 14:05:01.000000000 +0200
82 +++ pepperspot-0.4/src/tun.c    2012-05-28 16:20:10.000000000 +0300
83 @@ -226,7 +226,7 @@
84    struct sockaddr_nl local;
85    int addr_len = 0;
86    int fd = -1;
87 -  int status = 0;
88 +  int status __attribute__((__unused__)) = 0;
89  
90    struct sockaddr_nl nladdr;
91    struct iovec iov;
92 @@ -507,7 +507,7 @@
93   * \param delete 1 = delete route, 0 = add route
94   * \return 0 if success, -1 otherwise
95   */
96 -static int tun_route(struct tun_t *this,
97 +static int tun_route(struct tun_t *this __attribute__((__unused__)),
98                       struct in_addr *dst,
99                       struct in_addr *gateway,
100                       struct in_addr *mask,
101 Index: pepperspot-0.4/src/dhcp.c
102 ===================================================================
103 --- pepperspot-0.4.orig/src/dhcp.c      2012-05-28 15:57:59.000000000 +0300
104 +++ pepperspot-0.4/src/dhcp.c   2012-05-28 16:42:50.000000000 +0300
105 @@ -2111,7 +2111,7 @@
106    return 0;
107  }
108  
109 -struct timeval* dhcp_timeleft(struct dhcp_t *this, struct timeval *tvp)
110 +struct timeval* dhcp_timeleft(struct dhcp_t *this __attribute__((__unused__)), struct timeval *tvp)
111  {
112    /* To avoid unused parameter warning */
113    this = NULL;
114 @@ -2640,7 +2640,7 @@
115   * \return 0 if success, -1 otherwise4
116   */
117  static int dhcp_sendOFFER(struct dhcp_conn_t *conn,
118 -                          struct dhcp_fullpacket_t *pack, int len)
119 +                          struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__)))
120  {
121    struct dhcp_t *this = conn->parent;
122    struct dhcp_fullpacket_t packet;
123 @@ -2762,7 +2762,7 @@
124   * \return 0 if success, -1 otherwise
125   */
126  static int dhcp_sendACK(struct dhcp_conn_t *conn,
127 -                        struct dhcp_fullpacket_t *pack, int len)
128 +                        struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__)))
129  {
130    struct dhcp_t *this = conn->parent;
131    struct dhcp_fullpacket_t packet;
132 @@ -2895,7 +2895,7 @@
133   * \return 0 if success, -1 otherwise
134   */
135  static int dhcp_sendNAK(struct dhcp_conn_t *conn,
136 -                        struct dhcp_fullpacket_t *pack, int len)
137 +                        struct dhcp_fullpacket_t *pack, int len __attribute__((__unused__)))
138  {
139    struct dhcp_t *this = conn->parent;
140    struct dhcp_fullpacket_t packet;
141 @@ -3496,7 +3496,7 @@
142   * \return 0
143   */
144  static int dhcp_sendARP(struct dhcp_conn_t *conn,
145 -                        struct dhcp_arp_fullpacket_t *pack, int len)
146 +                        struct dhcp_arp_fullpacket_t *pack, int len __attribute__((__unused__)))
147  {
148    struct dhcp_t *this = conn->parent;
149    struct dhcp_arp_fullpacket_t packet;
150 Index: pepperspot-0.4/src/radius.c
151 ===================================================================
152 --- pepperspot-0.4.orig/src/radius.c    2012-05-28 15:57:59.000000000 +0300
153 +++ pepperspot-0.4/src/radius.c 2012-05-28 16:37:47.000000000 +0300
154 @@ -210,7 +210,7 @@
155   * \param secretlen length of secret
156   * \return 0
157   */
158 -static int radius_authresp_authenticator(struct radius_t *this,
159 +static int radius_authresp_authenticator(struct radius_t *this __attribute__((__unused__)),
160                                    struct radius_packet_t *pack,
161                                    uint8_t *req_auth,
162                                    char *secret, int secretlen)
163 @@ -801,7 +801,7 @@
164    return 0;
165  }
166  
167 -int radius_addattrv6(struct radius_t *this, struct radius_packet_t *pack,
168 +int radius_addattrv6(struct radius_t *this __attribute__((__unused__)), struct radius_packet_t *pack,
169                   uint8_t type, uint32_t vendor_id, uint8_t vendor_type,
170                   struct in6_addr value, uint8_t *data, uint16_t dlen)
171  {
172 @@ -1124,7 +1124,7 @@
173    return 0;
174  }
175  
176 -int radius_keydecode(struct radius_t *this, uint8_t *dst, int dstsize,
177 +int radius_keydecode(struct radius_t *this __attribute__((__unused__)), uint8_t *dst, int dstsize,
178                       int *dstlen, uint8_t *src, int srclen,
179                       uint8_t *authenticator, char *secret, int secretlen)
180  {
181 @@ -1346,7 +1346,7 @@
182    return 0;
183  }
184  
185 -int radius_pwencode(struct radius_t *this, uint8_t *dst, int dstsize,
186 +int radius_pwencode(struct radius_t *this __attribute__((__unused__)), uint8_t *dst, int dstsize,
187                      int *dstlen, uint8_t *src, int srclen,
188                      uint8_t *authenticator, char *secret, int secretlen)
189  {
190 Index: pepperspot-0.4/src/redir.c
191 ===================================================================
192 --- pepperspot-0.4.orig/src/redir.c     2012-05-28 15:57:59.000000000 +0300
193 +++ pepperspot-0.4/src/redir.c  2012-05-28 16:41:17.000000000 +0300
194 @@ -974,7 +974,7 @@
195   * \param dstsize size of dst
196   * \return 0 if success, -1 otherwise
197   */
198 -static int redir_getpath(struct redir_t *redir, char *src, char *dst, int dstsize)
199 +static int redir_getpath(struct redir_t *redir __attribute__((__unused__)), char *src, char *dst, int dstsize)
200  {
201    char *p1 = NULL;
202    char *p2 = NULL;
203 @@ -1045,7 +1045,7 @@
204  /**
205   * \brief Get the url of an HTTP request.
206   */
207 -static int redir_geturl(struct redir_t *redir, char *src, char *dst, int dstsize)
208 +static int redir_geturl(struct redir_t *redir __attribute__((__unused__)), char *src, char *dst, int dstsize)
209  {
210    char *p1 = NULL;
211    char *p3 = NULL;
212 @@ -1128,7 +1128,7 @@
213   * \return 0 if found, -1 otherwise (not found, malformed HTTP response)
214   */
215  /* TODO: Should be merged with other parsers */
216 -static int redir_getparam(struct redir_t *redir, char *src,
217 +static int redir_getparam(struct redir_t *redir __attribute__((__unused__)), char *src,
218                            char *param,
219                            char *dst, int dstsize)
220  {
221 @@ -1362,9 +1362,9 @@
222   * \param cbp pointer for callback
223   * \return 0
224   */
225 -static int redir_cb_radius_auth_conf(struct radius_t *radius,
226 +static int redir_cb_radius_auth_conf(struct radius_t *radius __attribute__((__unused__)),
227                                       struct radius_packet_t *pack,
228 -                                     struct radius_packet_t *pack_req, void *cbp)
229 +                                     struct radius_packet_t *pack_req __attribute__((__unused__)), void *cbp)
230  {
231    struct radius_attr_t *interimattr = NULL;
232    struct radius_attr_t *stateattr = NULL;
233 @@ -1696,7 +1696,7 @@
234   * \param conn redir connection
235   * \return 0 if success, -1 otherwise
236   */
237 -static int redir_radius(struct redir_t *redir, struct sockaddr_storage *addr,
238 +static int redir_radius(struct redir_t *redir, struct sockaddr_storage *addr __attribute__((__unused__)),
239                          struct redir_conn_t *conn)
240  {
241    struct radius_t *radius = NULL;      /* Radius client instance */
242 Index: pepperspot-0.4/src/tun6.c
243 ===================================================================
244 --- pepperspot-0.4.orig/src/tun6.c      2009-11-09 17:01:57.000000000 +0200
245 +++ pepperspot-0.4/src/tun6.c   2012-05-28 16:44:07.000000000 +0300
246 @@ -1080,7 +1080,7 @@
247    return code;
248  }
249  
250 -int tun6_addroute(struct tun6_t *this, struct in6_addr *dst, struct in6_addr *gateway, uint8_t prefixlen)
251 +int tun6_addroute(struct tun6_t *this __attribute__((__unused__)), struct in6_addr *dst __attribute__((__unused__)), struct in6_addr *gateway __attribute__((__unused__)), uint8_t prefixlen __attribute__((__unused__)))
252  {
253    /* TODO : use _iface_route */
254    this = NULL;
255 @@ -1096,7 +1096,7 @@
256    return 0;
257  }
258  
259 -int tun6_runscript(struct tun6_t *tun, char* script)
260 +int tun6_runscript(struct tun6_t *tun __attribute__((__unused__)), char* script __attribute__((__unused__)))
261  {
262    /* TODO */
263    tun = NULL;