mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
Play with includes so that libalias can be compiled both as userland
library and kernel module.
This commit is contained in:
parent
2891ace6c8
commit
c649a2e033
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145921
@ -111,7 +111,12 @@ __FBSDID("$FreeBSD$");
|
||||
See HISTORY file for additional revisions.
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
@ -120,10 +125,13 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#include "alias.h"
|
||||
#endif
|
||||
|
||||
#define NETBIOS_NS_PORT_NUMBER 137
|
||||
#define NETBIOS_DGM_PORT_NUMBER 138
|
||||
|
@ -29,14 +29,24 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/udp.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
/* CU-SeeMe Data Header */
|
||||
struct cu_header {
|
||||
|
@ -142,28 +142,42 @@ __FBSDID("$FreeBSD$");
|
||||
See HISTORY file for additional revisions.
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* System include files */
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/module.h>
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
/* BSD network include files */
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias.h>
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#else
|
||||
#include "alias.h"
|
||||
#include "alias_local.h"
|
||||
|
||||
#endif
|
||||
|
||||
static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead);
|
||||
|
||||
|
@ -69,16 +69,28 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/ctype.h>
|
||||
#include <sys/libkern.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
#define FTP_CONTROL_PORT_NUMBER 21
|
||||
#define MAX_MESSAGE_SIZE 128
|
||||
|
@ -48,17 +48,30 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/libkern.h>
|
||||
#include <sys/ctype.h>
|
||||
#include <sys/limits.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
/* Local defines */
|
||||
#define DBprintf(a)
|
||||
|
@ -41,18 +41,29 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/ctype.h>
|
||||
#include <sys/libkern.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/udp.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
struct in_addr oldaddr;
|
||||
|
@ -27,10 +27,20 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These functions are for backwards compatibility and because apps may
|
||||
|
@ -66,15 +66,23 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
/* Includes */
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PPTP definitions
|
||||
|
@ -54,14 +54,23 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
|
||||
/* System includes */
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/ctype.h>
|
||||
#include <sys/libkern.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/limits.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
/* BSD IPV4 includes */
|
||||
#include <netinet/in_systm.h>
|
||||
@ -69,12 +78,13 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h" /* Functions used by alias*.c */
|
||||
#include "alias.h" /* Public API functions for libalias */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
Data structures
|
||||
|
@ -30,19 +30,28 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* alias_skinny.c handles the translation for the Cisco Skinny Station
|
||||
|
@ -98,16 +98,27 @@ __FBSDID("$FreeBSD$");
|
||||
Initial version: May, 2000 (eds)
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/libkern.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#include <netinet/libalias/alias.h>
|
||||
#else
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
#define RTSP_CONTROL_PORT_NUMBER_1 554
|
||||
#define RTSP_CONTROL_PORT_NUMBER_2 7070
|
||||
|
@ -50,15 +50,25 @@ then these routines will give a result of zero (useful for testing
|
||||
purposes);
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <netinet/libalias/alias.h>
|
||||
#include <netinet/libalias/alias_local.h>
|
||||
#else
|
||||
#include "alias.h"
|
||||
#include "alias_local.h"
|
||||
#endif
|
||||
|
||||
u_short
|
||||
LibAliasInternetChecksum(struct libalias *la, u_short * ptr, int nbytes)
|
||||
|
Loading…
Reference in New Issue
Block a user