REORG: include: move port_range.h to haproxy/port_range{,-t}.h

The port ranges didn't depend on anything. However they were missing
some includes such as stdlib and api-t.h which were added.
This commit is contained in:
Willy Tarreau 2020-06-03 19:20:59 +02:00
parent 334099c324
commit fc8f6a8517
9 changed files with 72 additions and 68 deletions

View File

@ -0,0 +1,40 @@
/*
* include/haproxy/port_range-t.h
* This file defines the prt_range type
*
* Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, version 2.1
* exclusively.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _HAPROXY_PORT_RANGE_T_H
#define _HAPROXY_PORT_RANGE_T_H
#include <netinet/in.h>
#include <haproxy/api-t.h>
struct port_range {
int size, get, put_h, put_t; /* range size, and get/put positions */
uint16_t ports[0]; /* array of <size> ports, in host byte order */
};
#endif /* _HAPROXY_PORT_RANGE_T_H */
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* End:
*/

View File

@ -1,28 +1,31 @@
/*
include/proto/port_range.h
This file defines everything needed to manage port ranges
* include/haproxy/port_range.h
* This file defines everything needed to manage port ranges
*
* Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, version 2.1
* exclusively.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1
exclusively.
#ifndef _HAPROXY_PORT_RANGE_H
#define _HAPROXY_PORT_RANGE_H
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PROTO_PORT_RANGE_H
#define _PROTO_PORT_RANGE_H
#include <types/port_range.h>
#include <stdlib.h>
#include <haproxy/atomic.h>
#include <haproxy/api.h>
#include <haproxy/port_range-t.h>
#define GET_NEXT_OFF(range, off) ((off) == (range)->size - 1 ? 0 : (off) + 1)
@ -91,7 +94,7 @@ static inline struct port_range *port_range_alloc_range(int n)
return ret;
}
#endif /* _PROTO_PORT_RANGE_H */
#endif /* _HAPROXY_PORT_RANGE_H */
/*
* Local variables:

View File

@ -30,7 +30,7 @@
#include <types/listener.h>
#include <types/obj_type.h>
#include <types/port_range.h>
#include <haproxy/port_range-t.h>
#include <haproxy/protocol-t.h>
#include <netinet/in_systm.h>

View File

@ -24,7 +24,7 @@
#include <haproxy/api-t.h>
#include <import/ist.h>
#include <types/port_range.h>
#include <haproxy/port_range-t.h>
/* Direction for each FD event update */
enum {

View File

@ -1,39 +0,0 @@
/*
include/types/port_range.h
This file defines everything needed to manage port ranges
Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1
exclusively.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _TYPES_PORT_RANGE_H
#define _TYPES_PORT_RANGE_H
#include <netinet/in.h>
struct port_range {
int size, get, put_h, put_t; /* range size, and get/put positions */
uint16_t ports[0]; /* array of <size> ports, in host byte order */
};
#endif /* _TYPES_PORT_RANGE_H */
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* End:
*/

View File

@ -57,7 +57,7 @@
#include <proto/log.h>
#include <proto/mux_pt.h>
#include <proto/queue.h>
#include <proto/port_range.h>
#include <haproxy/port_range.h>
#include <proto/proto_tcp.h>
#include <haproxy/protocol.h>
#include <proto/proxy.h>

View File

@ -93,7 +93,7 @@
#include <proto/fd.h>
#include <proto/log.h>
#include <proto/port_range.h>
#include <haproxy/port_range.h>
struct fdtab *fdtab = NULL; /* array of all the file descriptors */
struct polled_mask *polled_mask = NULL; /* Array for the polled_mask of each fd */

View File

@ -48,7 +48,7 @@
#include <proto/http_rules.h>
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/port_range.h>
#include <haproxy/port_range.h>
#include <haproxy/protocol.h>
#include <proto/http_ana.h>
#include <proto/proto_tcp.h>

View File

@ -34,7 +34,7 @@
#include <proto/cli.h>
#include <proto/checks.h>
#include <proto/connection.h>
#include <proto/port_range.h>
#include <haproxy/port_range.h>
#include <haproxy/protocol.h>
#include <proto/queue.h>
#include <proto/sample.h>