mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
Remove network constants out of internal.h
The HOST_NAME_MAX, INET_ADDRSTRLEN and VIR_LOOPBACK_IPV4_ADDR constants are only used by a handful of files, so are better kept in virsocketaddr.h or the source file that uses them. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
24241c236e
commit
d8f8c7a83d
@ -65,22 +65,6 @@
|
|||||||
# include "ignore-value.h"
|
# include "ignore-value.h"
|
||||||
# include "count-leading-zeros.h"
|
# include "count-leading-zeros.h"
|
||||||
|
|
||||||
/* On architectures which lack these limits, define them (ie. Cygwin).
|
|
||||||
* Note that the libvirt code should be robust enough to handle the
|
|
||||||
* case where actual value is longer than these limits (eg. by setting
|
|
||||||
* length correctly in second argument to gethostname and by always
|
|
||||||
* using strncpy instead of strcpy).
|
|
||||||
*/
|
|
||||||
# ifndef HOST_NAME_MAX
|
|
||||||
# define HOST_NAME_MAX 256
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifndef INET_ADDRSTRLEN
|
|
||||||
# define INET_ADDRSTRLEN 16
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
|
|
||||||
|
|
||||||
/* String equality tests, suggested by Jim Meyering. */
|
/* String equality tests, suggested by Jim Meyering. */
|
||||||
# define STREQ(a, b) (strcmp(a, b) == 0)
|
# define STREQ(a, b) (strcmp(a, b) == 0)
|
||||||
# define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0)
|
# define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0)
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "viruuid.h"
|
#include "viruuid.h"
|
||||||
#include "vircommand.h"
|
#include "vircommand.h"
|
||||||
|
#include "virsocketaddr.h"
|
||||||
#include "libxl_domain.h"
|
#include "libxl_domain.h"
|
||||||
#include "libxl_conf.h"
|
#include "libxl_conf.h"
|
||||||
#include "libxl_utils.h"
|
#include "libxl_utils.h"
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
#include "virnetdev.h"
|
#include "virnetdev.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "viratomic.h"
|
#include "viratomic.h"
|
||||||
|
#include "virsocketaddr.h"
|
||||||
#include "virthreadpool.h"
|
#include "virthreadpool.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
#include "virtime.h"
|
#include "virtime.h"
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "nwfilter_learnipaddr.h"
|
#include "nwfilter_learnipaddr.h"
|
||||||
#include "virnetdev.h"
|
#include "virnetdev.h"
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
|
#include "virsocketaddr.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_NWFILTER
|
#define VIR_FROM_THIS VIR_FROM_NWFILTER
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "cpu/cpu.h"
|
#include "cpu/cpu.h"
|
||||||
#include "domain_nwfilter.h"
|
#include "domain_nwfilter.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
|
#include "virsocketaddr.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "viratomic.h"
|
#include "viratomic.h"
|
||||||
#include "storage_conf.h"
|
#include "storage_conf.h"
|
||||||
|
@ -32,6 +32,18 @@
|
|||||||
# include <sys/un.h>
|
# include <sys/un.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* On architectures which lack these limits, define them (ie. Cygwin).
|
||||||
|
* Note that the libvirt code should be robust enough to handle the
|
||||||
|
* case where actual value is longer than these limits (eg. by setting
|
||||||
|
* length correctly in second argument to gethostname and by always
|
||||||
|
* using strncpy instead of strcpy).
|
||||||
|
*/
|
||||||
|
# ifndef INET_ADDRSTRLEN
|
||||||
|
# define INET_ADDRSTRLEN 16
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
union {
|
union {
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
|
@ -581,6 +581,10 @@ char *virIndexToDiskName(int idx, const char *prefix)
|
|||||||
# define AI_CANONIDN 0
|
# define AI_CANONIDN 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HOST_NAME_MAX
|
||||||
|
# define HOST_NAME_MAX 256
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Who knew getting a hostname could be so delicate. In Linux (and Unices
|
/* Who knew getting a hostname could be so delicate. In Linux (and Unices
|
||||||
* in general), many things depend on "hostname" returning a value that will
|
* in general), many things depend on "hostname" returning a value that will
|
||||||
* resolve one way or another. In the modern world where networks frequently
|
* resolve one way or another. In the modern world where networks frequently
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
#include "virtime.h"
|
#include "virtime.h"
|
||||||
#include "virhostcpu.h"
|
#include "virhostcpu.h"
|
||||||
|
#include "virsocketaddr.h"
|
||||||
|
|
||||||
#include "storage/storage_driver.h"
|
#include "storage/storage_driver.h"
|
||||||
#include "vz_sdk.h"
|
#include "vz_sdk.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user