Browse Source
Linux 3D LRF SSDP Service
Linux 3D LRF SSDP Service
220 changed files with 97576 additions and 39 deletions
-
1Linux_Workspace.vpw
-
94Projects/LRF_Server/Debug/server.conf
-
2Projects/LRF_Server/LRF_Server.vpj
-
28Projects/LRF_Server/makefile
-
61Projects/LRF_Slave/Debug/3DLRF.conf
-
48Projects/LRF_Slave/Debug/3DLRF.conf.backup
-
BINProjects/LRF_Slave/Debug/PRU_0_0.bin
-
BINProjects/LRF_Slave/Debug/PRU_0_1.bin
-
BINProjects/LRF_Slave/Debug/PRU_1_0.bin
-
BINProjects/LRF_Slave/Debug/PRU_1_1.bin
-
44Projects/LRF_Slave/Debug/TGD.conf
-
65Projects/LRF_Slave/Debug/default.conf
-
37Projects/LRF_Slave/Debug/example.conf
-
BINProjects/LRF_Slave/Debug/halt.bin
-
1Projects/LRF_Slave/Debug/json
-
94Projects/LRF_Slave/Debug/server.conf
-
336Projects/LRF_Slave/LRF_Slave.vpj
-
6Projects/LRF_Slave/LRF_Slave.vpw
-
47Projects/LRF_Slave/Release/3DLRF.conf
-
BINProjects/LRF_Slave/Release/PRU_0_0.bin
-
BINProjects/LRF_Slave/Release/PRU_0_1.bin
-
BINProjects/LRF_Slave/Release/PRU_1_0.bin
-
BINProjects/LRF_Slave/Release/PRU_1_1.bin
-
BINProjects/LRF_Slave/Release/halt.bin
-
9Projects/LRF_Slave/build
-
363Projects/LRF_Slave/makefile
-
18lib/App/3dSERVER/LRF_Server.cpp
-
1lib/App/3dSERVER/LRF_Server.h
-
38lib/data/net/netServer.h
-
1lib/data/protocol/protocol.cpp
-
16lib/data/ssdp/ssdpAnnouncer.cpp
-
2lib/hardware/soc/general/3DLRF.h
-
BINlib/hardware/socat-1.7.3.4.tar.bz2
-
18lib/hardware/socat-1.7.3.4/BUGREPORTS
-
1800lib/hardware/socat-1.7.3.4/CHANGES
-
339lib/hardware/socat-1.7.3.4/COPYING
-
127lib/hardware/socat-1.7.3.4/COPYING.OpenSSL
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.AIX-5-3
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.Cygwin-1-5-25
-
198lib/hardware/socat-1.7.3.4/Config/Makefile.DragonFly-2-8-2
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.FreeBSD-6-1
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.Linux-2-6-24
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.MacOSX-10-5
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.NetBSD-5-1
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.OpenBSD-4-3
-
195lib/hardware/socat-1.7.3.4/Config/Makefile.SunOS-5-10
-
523lib/hardware/socat-1.7.3.4/Config/config.AIX-5-3.h
-
522lib/hardware/socat-1.7.3.4/Config/config.Cygwin-1-5-25.h
-
545lib/hardware/socat-1.7.3.4/Config/config.DragonFly-2-8-2.h
-
522lib/hardware/socat-1.7.3.4/Config/config.FreeBSD-6-1.h
-
522lib/hardware/socat-1.7.3.4/Config/config.Linux-2-6-24.h
-
522lib/hardware/socat-1.7.3.4/Config/config.MacOSX-10-5.h
-
522lib/hardware/socat-1.7.3.4/Config/config.NetBSD-5-1.h
-
522lib/hardware/socat-1.7.3.4/Config/config.OpenBSD-4-3.h
-
522lib/hardware/socat-1.7.3.4/Config/config.SunOS-5-10.h
-
222lib/hardware/socat-1.7.3.4/DEVELOPMENT
-
364lib/hardware/socat-1.7.3.4/EXAMPLES
-
96lib/hardware/socat-1.7.3.4/FAQ
-
82lib/hardware/socat-1.7.3.4/FILES
-
201lib/hardware/socat-1.7.3.4/Makefile.in
-
72lib/hardware/socat-1.7.3.4/PORTING
-
303lib/hardware/socat-1.7.3.4/README
-
67lib/hardware/socat-1.7.3.4/README.FIPS
-
41lib/hardware/socat-1.7.3.4/SECURITY
-
1lib/hardware/socat-1.7.3.4/VERSION
-
707lib/hardware/socat-1.7.3.4/compat.h
-
652lib/hardware/socat-1.7.3.4/config.h.in
-
19786lib/hardware/socat-1.7.3.4/configure
-
2024lib/hardware/socat-1.7.3.4/configure.ac
-
1lib/hardware/socat-1.7.3.4/configure.in
-
34lib/hardware/socat-1.7.3.4/daemon.sh
-
229lib/hardware/socat-1.7.3.4/dalan.c
-
30lib/hardware/socat-1.7.3.4/dalan.h
-
9lib/hardware/socat-1.7.3.4/doc/dest-unreach.css
-
327lib/hardware/socat-1.7.3.4/doc/socat-genericsocket.html
-
392lib/hardware/socat-1.7.3.4/doc/socat-multicast.html
-
192lib/hardware/socat-1.7.3.4/doc/socat-openssltunnel.html
-
169lib/hardware/socat-1.7.3.4/doc/socat-tun.html
-
3748lib/hardware/socat-1.7.3.4/doc/socat.1
-
3627lib/hardware/socat-1.7.3.4/doc/socat.html
-
3562lib/hardware/socat-1.7.3.4/doc/socat.yo
-
4976lib/hardware/socat-1.7.3.4/doc/xio.help
-
488lib/hardware/socat-1.7.3.4/error.c
-
249lib/hardware/socat-1.7.3.4/error.h
-
329lib/hardware/socat-1.7.3.4/fdname.c
-
990lib/hardware/socat-1.7.3.4/filan.c
-
39lib/hardware/socat-1.7.3.4/filan.h
-
248lib/hardware/socat-1.7.3.4/filan_main.c
-
158lib/hardware/socat-1.7.3.4/ftp.sh
-
172lib/hardware/socat-1.7.3.4/gatherinfo.sh
-
103lib/hardware/socat-1.7.3.4/hostan.c
-
10lib/hardware/socat-1.7.3.4/hostan.h
-
250lib/hardware/socat-1.7.3.4/install-sh
-
73lib/hardware/socat-1.7.3.4/mail.sh
-
25lib/hardware/socat-1.7.3.4/mytypes.h
-
270lib/hardware/socat-1.7.3.4/nestlex.c
-
23lib/hardware/socat-1.7.3.4/nestlex.h
-
164lib/hardware/socat-1.7.3.4/procan-cdefs.c
-
169lib/hardware/socat-1.7.3.4/procan.c
-
11lib/hardware/socat-1.7.3.4/procan.h
@ -0,0 +1,94 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "localhost"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
DUMP_TH_ON_DISK = false; |
|||
MASTER_ROLE = true; |
|||
SUNBIT_ENABLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 64; |
|||
TH_FLIP = 16; |
|||
TH_GOOD_POINTS = 8; |
|||
TH_GENERATED_BY_PRU = false; |
|||
TH_SPIKE_SIZE = 1; |
|||
CAN_BUS_ENABLE = true; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 768; |
|||
CAN_TGZ_ID = 769; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
BASE_SHIFT = 0; |
|||
MIRROR_SHIFT = 0; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
ENABLE_DEFENDER = false; |
|||
DETECTOR_WIDTH = 1000; |
|||
ENABLED_LRF = 255; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/xml"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.103"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
DEFENDER_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/json"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
CEP_IP_ADDRESS = "192.168.200.103"; |
|||
CEP_IP_PORT = 80; |
|||
LOCATION_LON = 35.0938962; |
|||
LOCATION_LAT = 32.904208; |
|||
USE_SSL = false; |
|||
ACCESS_URL = "/defender-eps/rest/simple-event/notify"; |
|||
}; |
|||
}; |
|||
PROTOCOL : |
|||
{ |
|||
}; |
|||
GENERAL : |
|||
{ |
|||
}; |
|||
SSDP : |
|||
{ |
|||
DEVICE_TYPE = "urn:schemas-upnp-org:device:InternetGatewayDevice:1"; |
|||
SERVER_STRING = "3DLRF-M"; |
|||
DEVICE_FRIENDLY_NAME = "3D Lidar Master Device"; |
|||
DEVICE_UUID = "47035424-731b-4d83-98c5-c4310993bbb3"; |
|||
MANUFACTURER = "Dr.Frucht Systems"; |
|||
MANUFACTURER_URL = "http://www.smartsecsystems.com"; |
|||
MODEL_NAME = "3DLRF-280-M"; |
|||
DEVICE_SERIAL_NUMBER = "1.0.12"; |
|||
PRESENTATION_URL = "http://%%s/"; |
|||
ICONS : |
|||
{ |
|||
ICON_0 : |
|||
{ |
|||
FORMAT = "png"; |
|||
WIDTH = 32; |
|||
HEIGHT = 32; |
|||
DEPTH = 32; |
|||
URL = "http://%%s/favicon-32x32.png"; |
|||
}; |
|||
}; |
|||
SERVICES : |
|||
{ |
|||
}; |
|||
}; |
|||
@ -0,0 +1,61 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "192.168.200.107"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
MASTER_ROLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = false; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
VERTICAL_MOTOR_CTRL = false; |
|||
HORIZONTAL_MOTOR_CTRL = false; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 16; |
|||
TH_FLIP = 8; |
|||
TH_GOOD_POINTS = 6; |
|||
CAN_BUS_ENABLE = false; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 512; |
|||
CAN_TGZ_ID = 513; |
|||
TGZ_DIV = 1; |
|||
TGZ_RATIO = 64; |
|||
TGZ_PRF = 35; |
|||
TH_GENERATED_BY_PRU = false; |
|||
DUMP_TH_ON_DISK = false; |
|||
TH_SPIKE_SIZE = 1; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
SUNBIT_ENABLE = false; |
|||
BASE_SHIFT = 0; |
|||
MIRROR_SHIFT = 0; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
DETECTOR_WIDTH = 200; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_LIBERMAN_MASTER"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.125"; |
|||
LCU_IP_PORT = 80; |
|||
CURL_POST_CONTENT_TYPE = "application/xml"; |
|||
}; |
|||
ENABLED_LRF = 255; |
|||
ENABLE_DEFENDER = true; |
|||
DEFENDER_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
CEP_IP_ADDRESS = "192.168.200.125"; |
|||
CEP_IP_PORT = 80; |
|||
CURL_POST_CONTENT_TYPE = "application/json"; |
|||
}; |
|||
}; |
|||
@ -0,0 +1,48 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "192.168.200.108"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
MASTER_ROLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 16; |
|||
TH_FLIP = 8; |
|||
TH_GOOD_POINTS = 6; |
|||
CAN_BUS_ENABLE = false; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 512; |
|||
CAN_TGZ_ID = 513; |
|||
TGZ_DIV = 1; |
|||
TGZ_RATIO = 64; |
|||
TGZ_PRF = 35; |
|||
TH_GENERATED_BY_PRU = false; |
|||
DUMP_TH_ON_DISK = false; |
|||
TH_SPIKE_SIZE = 5; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
SUNBIT_ENABLE = false; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
DETECTOR_WIDTH = 200; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_LIBERMAN_MASTER"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.204"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
}; |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,44 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "192.168.0.108"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
MASTER_ROLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 64; |
|||
TH_FLIP = 16; |
|||
TH_GOOD_POINTS = 6; |
|||
CAN_BUS_ENABLE = true; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 768; |
|||
CAN_TGZ_ID = 769; |
|||
TH_GENERATED_BY_PRU = true; |
|||
DUMP_TH_ON_DISK = true; |
|||
TH_SPIKE_SIZE = 0; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
}; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.0.100"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
DETECTOR_WIDTH = 200; |
|||
DETECTOR_SST = 0; |
|||
}; |
|||
@ -0,0 +1,65 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "localhost"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
DUMP_TH_ON_DISK = false; |
|||
MASTER_ROLE = true; |
|||
SUNBIT_ENABLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 64; |
|||
TH_FLIP = 16; |
|||
TH_GOOD_POINTS = 8; |
|||
TH_GENERATED_BY_PRU = false; |
|||
TH_SPIKE_SIZE = 1; |
|||
CAN_BUS_ENABLE = true; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 768; |
|||
CAN_TGZ_ID = 769; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
BASE_SHIFT = 0; |
|||
MIRROR_SHIFT = 0; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
ENABLE_DEFENDER = false; |
|||
DETECTOR_WIDTH = 1000; |
|||
ENABLED_LRF = 255; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/xml"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.103"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
DEFENDER_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/json"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
CEP_IP_ADDRESS = "192.168.200.103"; |
|||
CEP_IP_PORT = 80; |
|||
LOCATION_LON = 35.0938962; |
|||
LOCATION_LAT = 32.904208; |
|||
USE_SSL = false; |
|||
ACCESS_URL = "/defender-eps/rest/simple-event/notify"; |
|||
}; |
|||
}; |
|||
PROTOCOL : |
|||
{ |
|||
}; |
|||
@ -0,0 +1,37 @@ |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.0.101"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
HW_ROLE = true; |
|||
HW_LRF_ENABLED = false; |
|||
HW_SIMULATION_ENABLED = false; |
|||
HW_SIMULATION_FREQ = 12000; |
|||
HW_VERTICAL_MOTOR_CTRL = true; |
|||
HW_HORIZONTAL_MOTOR_CTRL = true; |
|||
HW_MOTORS_AUTOSTART = false; |
|||
HW_VERTICAL_ENC_FREQ = 57600; |
|||
HW_HORIZONTAL_ENC_FREQ = 4000; |
|||
HW_LRF_PULSES_INTERLEAVE = 4; |
|||
HW_TH_GENERATED_BY_PRU = true; |
|||
HW_TH_OFFSET = 32; |
|||
HW_TH_ORDER = 3; |
|||
HW_TH_DELTA = 12; |
|||
HW_TH_FLIP = 16; |
|||
HW_TH_GOOD_POINTS = 8; |
|||
HW_CAN_BUS_ENABLE = true; |
|||
HW_CAN_BUS_ID = 1; |
|||
HW_CAN_MY_ID = 512; |
|||
HW_CAN_TGZ_ID = 513; |
|||
HW_TGZ_DIV = 1; |
|||
HW_TGZ_PRF = 35000; |
|||
}; |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "192.168.0.108"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
Binary file not shown.
@ -0,0 +1 @@ |
|||
{"id": 1,"category": "STATUS","severity": "very-low","receivedTS": "2019-04-04T11:39:21.906Z","lastChangeTS": "2019-04-04T11:39:21.906Z","startTime": "2019-04-04T11:39:21.906Z","endTime": "2019-04-04T11:39:21.906Z", "location": {"point": [ 32.878, 35.999 ], "heading": 128, "area": [] }, "radius": 0, "data": [ {"description": "Status Message", "created": "2019-04-04T11:39:21.904Z", "source": { "providerId": "DFSL_3D_LIDAR", "sensorNodeId" : "MASTER_SENSOR", "sensorId": "LRF_3D_001" }, "name": "DFSL_STATUS_DATA", "type": "EventLidarStatus", "eventId": "cfea99b97c919c83cf84fba71cb6f9dc", "payload": [{ "status": "Operational" }] } ]} |
|||
@ -0,0 +1,94 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "localhost"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
DUMP_TH_ON_DISK = false; |
|||
MASTER_ROLE = true; |
|||
SUNBIT_ENABLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 64; |
|||
TH_FLIP = 16; |
|||
TH_GOOD_POINTS = 8; |
|||
TH_GENERATED_BY_PRU = false; |
|||
TH_SPIKE_SIZE = 1; |
|||
CAN_BUS_ENABLE = true; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 768; |
|||
CAN_TGZ_ID = 769; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
BASE_SHIFT = 0; |
|||
MIRROR_SHIFT = 0; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
ENABLE_DEFENDER = false; |
|||
DETECTOR_WIDTH = 1000; |
|||
ENABLED_LRF = 255; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/xml"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.103"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
DEFENDER_CONNECTION : |
|||
{ |
|||
CURL_POST_CONTENT_TYPE = "application/json"; |
|||
SCANNER_NAME = "LRF_3D_001"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
CEP_IP_ADDRESS = "192.168.200.103"; |
|||
CEP_IP_PORT = 80; |
|||
LOCATION_LON = 35.0938962; |
|||
LOCATION_LAT = 32.904208; |
|||
USE_SSL = false; |
|||
ACCESS_URL = "/defender-eps/rest/simple-event/notify"; |
|||
}; |
|||
}; |
|||
PROTOCOL : |
|||
{ |
|||
}; |
|||
GENERAL : |
|||
{ |
|||
}; |
|||
SSDP : |
|||
{ |
|||
DEVICE_TYPE = "urn:schemas-upnp-org:device:InternetGatewayDevice:1"; |
|||
SERVER_STRING = "3DLRF-M"; |
|||
DEVICE_FRIENDLY_NAME = "3D Lidar Master Device"; |
|||
DEVICE_UUID = "47035424-731b-4d83-98c5-c4310993bbb3"; |
|||
MANUFACTURER = "Dr.Frucht Systems"; |
|||
MANUFACTURER_URL = "http://www.smartsecsystems.com"; |
|||
MODEL_NAME = "3DLRF-280-M"; |
|||
DEVICE_SERIAL_NUMBER = "1.0.12"; |
|||
PRESENTATION_URL = "http://%%s/"; |
|||
ICONS : |
|||
{ |
|||
ICON_0 : |
|||
{ |
|||
FORMAT = "png"; |
|||
WIDTH = 32; |
|||
HEIGHT = 32; |
|||
DEPTH = 32; |
|||
URL = "http://%%s/favicon-32x32.png"; |
|||
}; |
|||
}; |
|||
SERVICES : |
|||
{ |
|||
}; |
|||
}; |
|||
@ -0,0 +1,336 @@ |
|||
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd"> |
|||
<Project |
|||
Version="10.0" |
|||
VendorName="SlickEdit" |
|||
TemplateName="GNU C/C++" |
|||
WorkingDir="." |
|||
BuildSystem="automakefile" |
|||
BuildMakeFile="makefile" |
|||
VCSProject="Git:"> |
|||
<Config |
|||
Name="Debug" |
|||
Type="gnuc" |
|||
DebugCallbackName="gdb" |
|||
Version="1" |
|||
OutputFile="%bdLRF_Server" |
|||
CompilerConfigName="Latest Version" |
|||
Defines='"/D_THREAD_SAFE" "/D_BSD_SOURCE" "/D_REENTRANT" "/DDEBUG"'> |
|||
<Menu> |
|||
<Target |
|||
Name="Compile" |
|||
MenuCaption="&Compile" |
|||
Dialog="_gnuc_options_form Compile" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
OutputExts="*.o" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='g++ -c %xup -x c++ %defd -O0 -g3 -ggdb -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f' |
|||
OtherOptions="-std=gnu++11 -I../../lib/include"/> |
|||
</Target> |
|||
<Target |
|||
Name="Link" |
|||
MenuCaption="&Link" |
|||
ShowOnMenu="Never" |
|||
Dialog="_gnuc_options_form Link" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='g++ %xup -O0 -g3 -ggdb -w %~other -o "%o" %objs' |
|||
OtherOptions="-lconfig -lpthread -lelf -lcurses -lcdk -lcurl"/> |
|||
</Target> |
|||
<Target |
|||
Name="Build" |
|||
MenuCaption="&Build" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Rebuild" |
|||
MenuCaption="&Rebuild" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Debug" |
|||
MenuCaption="&Debug" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveNone" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='vsdebugio -prog "%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="Execute" |
|||
MenuCaption="E&xecute" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='"%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="dash" |
|||
MenuCaption="-" |
|||
Deletable="0"> |
|||
<Exec/> |
|||
</Target> |
|||
<Target |
|||
Name="GNU C Options" |
|||
MenuCaption="GNU C &Options..." |
|||
ShowOnMenu="HideIfNoCmdLine" |
|||
Deletable="0" |
|||
SaveOption="SaveNone"> |
|||
<Exec |
|||
CmdLine="gnucoptions" |
|||
Type="Slick-C"/> |
|||
</Target> |
|||
</Menu> |
|||
<List Name="GNUC Options"> |
|||
<Item |
|||
Name="LinkerOutputType" |
|||
Value="Executable"/> |
|||
</List> |
|||
<Includes> |
|||
</Includes> |
|||
<Libs PreObjects="0"/> |
|||
</Config> |
|||
<Config |
|||
Name="Release" |
|||
Type="gnuc" |
|||
DebugCallbackName="gdb" |
|||
Version="1" |
|||
OutputFile="%bdLRF_Server" |
|||
CompilerConfigName="Latest Version" |
|||
Defines='"/D_THREAD_SAFE" "/D_BSD_SOURCE" "/D_REENTRANT"'> |
|||
<Menu> |
|||
<Target |
|||
Name="Compile" |
|||
MenuCaption="&Compile" |
|||
Dialog="_gnuc_options_form Compile" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
OutputExts="*.o" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='g++ -c %xup -x c++ %defd -O3 -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f' |
|||
OtherOptions="-std=gnu++11 -I../../lib/include"/> |
|||
</Target> |
|||
<Target |
|||
Name="Link" |
|||
MenuCaption="&Link" |
|||
ShowOnMenu="Never" |
|||
Dialog="_gnuc_options_form Link" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='g++ %xup -O3 -w %~other -o "%o" %objs' |
|||
OtherOptions="-lconfig -lpthread -lelf -lcurses -lcdk -lcurl -s"/> |
|||
</Target> |
|||
<Target |
|||
Name="Build" |
|||
MenuCaption="&Build" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Rebuild" |
|||
MenuCaption="&Rebuild" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Debug" |
|||
MenuCaption="&Debug" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveNone" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='vsdebugio -prog "%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="Execute" |
|||
MenuCaption="E&xecute" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='"%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="dash" |
|||
MenuCaption="-" |
|||
Deletable="0"> |
|||
<Exec/> |
|||
</Target> |
|||
<Target |
|||
Name="GNU C Options" |
|||
MenuCaption="GNU C &Options..." |
|||
ShowOnMenu="HideIfNoCmdLine" |
|||
Deletable="0" |
|||
SaveOption="SaveNone"> |
|||
<Exec |
|||
CmdLine="gnucoptions" |
|||
Type="Slick-C"/> |
|||
</Target> |
|||
</Menu> |
|||
<List Name="GNUC Options"> |
|||
<Item |
|||
Name="LinkerOutputType" |
|||
Value="Executable"/> |
|||
</List> |
|||
<Includes> |
|||
</Includes> |
|||
<Libs PreObjects="0"/> |
|||
</Config> |
|||
<Files> |
|||
<Folder |
|||
Name="Source Files" |
|||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d"> |
|||
<F N="../../lib/components/base/basicDualThread.cpp"/> |
|||
<F N="../../lib/components/base/basicEngine.cpp"/> |
|||
<F N="../../lib/components/base/basicEvent.cpp"/> |
|||
<F N="../../lib/components/base/basicEventHandler.cpp"/> |
|||
<F N="../../lib/components/base/basicEventHeap.cpp"/> |
|||
<F N="../../lib/components/base/basicFunctionality.cpp"/> |
|||
<F N="../../lib/components/base/basicLogCollection.cpp"/> |
|||
<F N="../../lib/components/base/basicLoggingService.cpp"/> |
|||
<F N="../../lib/components/base/basicMemoryOperation.cpp"/> |
|||
<F N="../../lib/components/base/basicObject.cpp"/> |
|||
<F N="../../lib/components/base/basicRing.cpp"/> |
|||
<F N="../../lib/components/base/basicSettings.cpp"/> |
|||
<F N="../../lib/components/base/basicSettingsProvider.cpp"/> |
|||
<F N="../../lib/components/base/basicThread.cpp"/> |
|||
<F N="../../lib/components/base/basicTransport.cpp"/> |
|||
<F N="../../lib/hardware/can/can_lib.c"/> |
|||
<F N="../../lib/hardware/can/canbus.cpp"/> |
|||
<F N="../../lib/hardware/soc/classSOC.cpp"/> |
|||
<F N="../../lib/data/net/clientPort.cpp"/> |
|||
<F N="../../lib/data/curl/curlRequest.cpp"/> |
|||
<F N="../../lib/data/curl/curlRequestsManager.cpp"/> |
|||
<F N="../../lib/alg/lgs/detector.cpp"/> |
|||
<F N="../../lib/data/json/json_reader.cpp"/> |
|||
<F N="../../lib/data/json/json_value.cpp"/> |
|||
<F N="../../lib/data/json/json_writer.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_ClientHandler.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_DefenderHandler.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Detector.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_HardwareManager.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Kernel.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_SafeShoreHandler.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Server.cpp"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_targetTracker.cpp"/> |
|||
<F N="../../lib/alg/lgs/mask.cpp"/> |
|||
<F N="../../lib/alg/generic/md5.cpp"/> |
|||
<F N="../../lib/data/net/netClientHandler.cpp"/> |
|||
<F N="../../lib/data/net/netServer.cpp"/> |
|||
<F N="../../lib/components/object/objectFileLoggingService.cpp"/> |
|||
<F N="../../lib/data/protocol/protocol.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolDefender.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolHTTP.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolLGS.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolRGoose.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolSafeShore.cpp"/> |
|||
<F N="../../lib/data/protocol/protocolTGZ.cpp"/> |
|||
<F N="../../lib/hardware/soc/modules/pru/pru_ss.c"/> |
|||
<F N="../../lib/hardware/soc/modules/pwmss/pwm_ss.c"/> |
|||
<F N="../../lib/data/net/serverPort.cpp"/> |
|||
<F N="../../lib/data/ssdp/ssdpAnnouncer.cpp"/> |
|||
<F N="../../lib/data/transport/transportSerial.cpp"/> |
|||
<F N="../../lib/data/net/transportSocket.cpp"/> |
|||
<F N="../../lib/data/net/xmlParser.cpp"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="Header Files" |
|||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if"> |
|||
<F N="../../lib/hardware/soc/general/3DLRF.h"/> |
|||
<F N="../../lib/components/base/basicDualThread.h"/> |
|||
<F N="../../lib/components/base/basicEngine.h"/> |
|||
<F N="../../lib/components/base/basicEvent.h"/> |
|||
<F N="../../lib/components/base/basicEventHandler.h"/> |
|||
<F N="../../lib/components/base/basicEventHeap.h"/> |
|||
<F N="../../lib/components/base/basicFunctionality.h"/> |
|||
<F N="../../lib/components/base/basicLogCollection.h"/> |
|||
<F N="../../lib/components/base/basicLoggingService.h"/> |
|||
<F N="../../lib/components/base/basicMemoryOperation.h"/> |
|||
<F N="../../lib/components/base/basicObject.h"/> |
|||
<F N="../../lib/components/base/basicSettings.h"/> |
|||
<F N="../../lib/components/base/basicSettingsProvider.h"/> |
|||
<F N="../../lib/components/base/basicThread.h"/> |
|||
<F N="../../lib/components/base/basicTypes.h"/> |
|||
<F N="../../lib/hardware/soc/classSOC.h"/> |
|||
<F N="../../lib/data/net/clientPort.h"/> |
|||
<F N="../../lib/data/curl/curlRequest.h"/> |
|||
<F N="../../lib/data/curl/curlRequestsManager.h"/> |
|||
<F N="../../lib/alg/lgs/detector.h"/> |
|||
<F N="../../lib/alg/lgs/detectorStructures.h"/> |
|||
<F N="../../lib/LgsLib.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_ClientHandler.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_DefenderHandler.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Detector.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_HardwareManager.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Kernel.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_SafeShoreHandler.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_Server.h"/> |
|||
<F N="../../lib/App/3dSERVER/LRF_targetTracker.h"/> |
|||
<F N="../../lib/alg/lgs/mask.h"/> |
|||
<F N="../../lib/data/net/netClientHandler.h"/> |
|||
<F N="../../lib/data/net/netServer.h"/> |
|||
<F N="../../lib/components/object/objectFileLoggingService.h"/> |
|||
<F N="../../lib/data/protocol/protocol.h"/> |
|||
<F N="../../lib/data/protocol/protocolDefender.h"/> |
|||
<F N="../../lib/data/protocol/protocolHTTP.h"/> |
|||
<F N="../../lib/data/protocol/protocolLGS.h"/> |
|||
<F N="../../lib/data/protocol/protocolRGoose.h"/> |
|||
<F N="../../lib/data/protocol/protocolSafeShore.h"/> |
|||
<F N="../../lib/data/protocol/protocolTGZ.h"/> |
|||
<F N="../../lib/hardware/soc/modules/pru/pru_ss.h"/> |
|||
<F N="../../lib/hardware/soc/modules/pwmss/pwm_ss.h"/> |
|||
<F N="../../lib/data/net/serverPort.h"/> |
|||
<F N="../../lib/data/ssdp/ssdpAnnouncer.h"/> |
|||
<F N="../../lib/data/transport/transportSerial.h"/> |
|||
<F N="../../lib/data/net/transportSocket.h"/> |
|||
<F N="../../lib/hardware/soc/modules/pru/tupus_ext.h"/> |
|||
<F N="../../lib/data/net/xmlParser.h"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="Resource Files" |
|||
Filters="*.ico;*.cur;*.dlg"/> |
|||
<Folder |
|||
Name="Bitmaps" |
|||
Filters="*.bmp"/> |
|||
<Folder |
|||
Name="Other Files" |
|||
Filters=""> |
|||
<F |
|||
N="makefile" |
|||
Type="Makefile"/> |
|||
</Folder> |
|||
</Files> |
|||
</Project> |
|||
@ -0,0 +1,6 @@ |
|||
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd"> |
|||
<Workspace Version="10.0" VendorName="SlickEdit"> |
|||
<Projects> |
|||
<Project File="LRF_Server.vpj"/> |
|||
</Projects> |
|||
</Workspace> |
|||
@ -0,0 +1,47 @@ |
|||
NETWORK_SERVER : |
|||
{ |
|||
NW_HOSTNAME_IP = "192.168.200.108"; |
|||
NW_LISTEN_PORT = 2222; |
|||
}; |
|||
HARDWARE_MANAGER : |
|||
{ |
|||
MASTER_ROLE = true; |
|||
LRF_ENABLED = true; |
|||
SIG_SYM_ENABLE = false; |
|||
MOTORS_AUTOSTART = true; |
|||
VERTICAL_ENC_FREQ = 57600; |
|||
HORIZONTAL_ENC_FREQ = 4000; |
|||
VERTICAL_MOTOR_CTRL = true; |
|||
HORIZONTAL_MOTOR_CTRL = true; |
|||
LRF_PULSES_INTERLEAVE = 4; |
|||
TH_OFFSET = 32; |
|||
TH_ORDER = 3; |
|||
TH_DELTA = 16; |
|||
TH_FLIP = 8; |
|||
TH_GOOD_POINTS = 6; |
|||
CAN_BUS_ENABLE = false; |
|||
CAN_BUS_ID = 1; |
|||
CAN_MY_ID = 512; |
|||
CAN_TGZ_ID = 513; |
|||
TGZ_DIV = 1; |
|||
TGZ_RATIO = 64; |
|||
TGZ_PRF = 35; |
|||
TH_GENERATED_BY_PRU = false; |
|||
DUMP_TH_ON_DISK = false; |
|||
TH_SPIKE_SIZE = 2; |
|||
TGZ_MIRROR_SPEED = 14400; |
|||
TGZ_BASE_SPEED = 250; |
|||
}; |
|||
KERNEL : |
|||
{ |
|||
ENABLE_SAFE_SHORE = false; |
|||
DETECTOR_WIDTH = 200; |
|||
DETECTOR_SST = 0; |
|||
SAFESHORE_CONNECTION : |
|||
{ |
|||
SCANNER_NAME = "LRF_LIBERMANDELLO"; |
|||
SCANNER_DIMENTIONS = 3; |
|||
LCU_IP_ADDRESS = "192.168.200.204"; |
|||
LCU_IP_PORT = 80; |
|||
}; |
|||
}; |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,9 @@ |
|||
#! /bin/sh |
|||
|
|||
|
|||
#make clean -e "CFG=Debug" |
|||
#make -e "CFG=Debug" |
|||
|
|||
|
|||
make clean -e "CFG=Release" |
|||
#make -e "CFG=Release" |
|||
@ -0,0 +1,363 @@ |
|||
# SlickEdit generated file. Do not edit this file except in designated areas.
|
|||
|
|||
# Make command to use for dependencies
|
|||
MAKE=make |
|||
RM=rm |
|||
MKDIR=mkdir |
|||
|
|||
# -----Begin user-editable area-----
|
|||
|
|||
# -----End user-editable area-----
|
|||
|
|||
# If no configuration is specified, "Debug" will be used
|
|||
ifndef CFG |
|||
CFG=Debug |
|||
endif |
|||
|
|||
#
|
|||
# Configuration: Debug
|
|||
#
|
|||
ifeq "$(CFG)" "Debug" |
|||
OUTDIR=Debug |
|||
OUTFILE=$(OUTDIR)/LRF_Server |
|||
CFG_INC= |
|||
CFG_LIB= |
|||
CFG_OBJ= |
|||
COMMON_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \
|
|||
$(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \
|
|||
$(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \
|
|||
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
|
|||
$(OUTDIR)/basicMemoryOperation.o $(OUTDIR)/basicObject.o \
|
|||
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettings.o \
|
|||
$(OUTDIR)/basicSettingsProvider.o $(OUTDIR)/basicThread.o \
|
|||
$(OUTDIR)/basicTransport.o $(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o \
|
|||
$(OUTDIR)/classSOC.o $(OUTDIR)/clientPort.o $(OUTDIR)/curlRequest.o \
|
|||
$(OUTDIR)/curlRequestsManager.o $(OUTDIR)/detector.o \
|
|||
$(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \
|
|||
$(OUTDIR)/json_writer.o $(OUTDIR)/LRF_ClientHandler.o \
|
|||
$(OUTDIR)/LRF_DefenderHandler.o $(OUTDIR)/LRF_Detector.o \
|
|||
$(OUTDIR)/LRF_HardwareManager.o $(OUTDIR)/LRF_Kernel.o \
|
|||
$(OUTDIR)/LRF_SafeShoreHandler.o $(OUTDIR)/LRF_Server.o \
|
|||
$(OUTDIR)/LRF_targetTracker.o $(OUTDIR)/mask.o $(OUTDIR)/md5.o \
|
|||
$(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \
|
|||
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
|
|||
$(OUTDIR)/protocolDefender.o $(OUTDIR)/protocolHTTP.o \
|
|||
$(OUTDIR)/protocolLGS.o $(OUTDIR)/protocolRGoose.o \
|
|||
$(OUTDIR)/protocolSafeShore.o $(OUTDIR)/protocolTGZ.o \
|
|||
$(OUTDIR)/pru_ss.o $(OUTDIR)/pwm_ss.o $(OUTDIR)/serverPort.o \
|
|||
$(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/transportSerial.o \
|
|||
$(OUTDIR)/transportSocket.o $(OUTDIR)/xmlParser.o |
|||
OBJ=$(COMMON_OBJ) $(CFG_OBJ) |
|||
ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \
|
|||
$(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \
|
|||
$(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \
|
|||
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
|
|||
$(OUTDIR)/basicMemoryOperation.o $(OUTDIR)/basicObject.o \
|
|||
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettings.o \
|
|||
$(OUTDIR)/basicSettingsProvider.o $(OUTDIR)/basicThread.o \
|
|||
$(OUTDIR)/basicTransport.o $(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o \
|
|||
$(OUTDIR)/classSOC.o $(OUTDIR)/clientPort.o $(OUTDIR)/curlRequest.o \
|
|||
$(OUTDIR)/curlRequestsManager.o $(OUTDIR)/detector.o \
|
|||
$(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \
|
|||
$(OUTDIR)/json_writer.o $(OUTDIR)/LRF_ClientHandler.o \
|
|||
$(OUTDIR)/LRF_DefenderHandler.o $(OUTDIR)/LRF_Detector.o \
|
|||
$(OUTDIR)/LRF_HardwareManager.o $(OUTDIR)/LRF_Kernel.o \
|
|||
$(OUTDIR)/LRF_SafeShoreHandler.o $(OUTDIR)/LRF_Server.o \
|
|||
$(OUTDIR)/LRF_targetTracker.o $(OUTDIR)/mask.o $(OUTDIR)/md5.o \
|
|||
$(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \
|
|||
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
|
|||
$(OUTDIR)/protocolDefender.o $(OUTDIR)/protocolHTTP.o \
|
|||
$(OUTDIR)/protocolLGS.o $(OUTDIR)/protocolRGoose.o \
|
|||
$(OUTDIR)/protocolSafeShore.o $(OUTDIR)/protocolTGZ.o \
|
|||
$(OUTDIR)/pru_ss.o $(OUTDIR)/pwm_ss.o $(OUTDIR)/serverPort.o \
|
|||
$(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/transportSerial.o \
|
|||
$(OUTDIR)/transportSocket.o $(OUTDIR)/xmlParser.o |
|||
|
|||
COMPILE=g++ -c -x c++ "-D_THREAD_SAFE" "-D_BSD_SOURCE" "-D_REENTRANT" "-DDEBUG" -O0 -g3 -ggdb -w -Wpointer-arith -std=gnu++11 -I../../lib/include -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< |
|||
LINK=g++ -O0 -g3 -ggdb -w -lconfig -lpthread -lelf -lcurses -lcdk -lcurl -o "$(OUTFILE)" $(ALL_OBJ) |
|||
|
|||
# Pattern rules
|
|||
$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pwmss/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/base/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/can/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pru/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/App/3dSERVER/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/object/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/net/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/curl/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/json/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/transport/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pwmss/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/lgs/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/protocol/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/ssdp/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/base/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/can/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/generic/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pru/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/App/3dSERVER/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/object/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/net/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/curl/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/json/%.c |
|||
$(COMPILE) |
|||
|
|||
# Build rules
|
|||
all: $(OUTFILE) |
|||
|
|||
$(OUTFILE): $(OUTDIR) $(OBJ) |
|||
$(LINK) |
|||
|
|||
$(OUTDIR): |
|||
$(MKDIR) -p "$(OUTDIR)" |
|||
|
|||
# Rebuild this project
|
|||
rebuild: cleanall all |
|||
|
|||
# Clean this project
|
|||
clean: |
|||
$(RM) -f $(OUTFILE) |
|||
$(RM) -f $(OBJ) |
|||
|
|||
# Clean this project and all dependencies
|
|||
cleanall: clean |
|||
endif |
|||
|
|||
#
|
|||
# Configuration: Release
|
|||
#
|
|||
ifeq "$(CFG)" "Release" |
|||
OUTDIR=Release |
|||
OUTFILE=$(OUTDIR)/LRF_Server |
|||
CFG_INC= |
|||
CFG_LIB= |
|||
CFG_OBJ= |
|||
COMMON_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \
|
|||
$(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \
|
|||
$(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \
|
|||
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
|
|||
$(OUTDIR)/basicMemoryOperation.o $(OUTDIR)/basicObject.o \
|
|||
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettings.o \
|
|||
$(OUTDIR)/basicSettingsProvider.o $(OUTDIR)/basicThread.o \
|
|||
$(OUTDIR)/basicTransport.o $(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o \
|
|||
$(OUTDIR)/classSOC.o $(OUTDIR)/clientPort.o $(OUTDIR)/curlRequest.o \
|
|||
$(OUTDIR)/curlRequestsManager.o $(OUTDIR)/detector.o \
|
|||
$(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \
|
|||
$(OUTDIR)/json_writer.o $(OUTDIR)/LRF_ClientHandler.o \
|
|||
$(OUTDIR)/LRF_DefenderHandler.o $(OUTDIR)/LRF_Detector.o \
|
|||
$(OUTDIR)/LRF_HardwareManager.o $(OUTDIR)/LRF_Kernel.o \
|
|||
$(OUTDIR)/LRF_SafeShoreHandler.o $(OUTDIR)/LRF_Server.o \
|
|||
$(OUTDIR)/LRF_targetTracker.o $(OUTDIR)/mask.o $(OUTDIR)/md5.o \
|
|||
$(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \
|
|||
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
|
|||
$(OUTDIR)/protocolDefender.o $(OUTDIR)/protocolHTTP.o \
|
|||
$(OUTDIR)/protocolLGS.o $(OUTDIR)/protocolRGoose.o \
|
|||
$(OUTDIR)/protocolSafeShore.o $(OUTDIR)/protocolTGZ.o \
|
|||
$(OUTDIR)/pru_ss.o $(OUTDIR)/pwm_ss.o $(OUTDIR)/serverPort.o \
|
|||
$(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/transportSerial.o \
|
|||
$(OUTDIR)/transportSocket.o $(OUTDIR)/xmlParser.o |
|||
OBJ=$(COMMON_OBJ) $(CFG_OBJ) |
|||
ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \
|
|||
$(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \
|
|||
$(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \
|
|||
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
|
|||
$(OUTDIR)/basicMemoryOperation.o $(OUTDIR)/basicObject.o \
|
|||
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettings.o \
|
|||
$(OUTDIR)/basicSettingsProvider.o $(OUTDIR)/basicThread.o \
|
|||
$(OUTDIR)/basicTransport.o $(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o \
|
|||
$(OUTDIR)/classSOC.o $(OUTDIR)/clientPort.o $(OUTDIR)/curlRequest.o \
|
|||
$(OUTDIR)/curlRequestsManager.o $(OUTDIR)/detector.o \
|
|||
$(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \
|
|||
$(OUTDIR)/json_writer.o $(OUTDIR)/LRF_ClientHandler.o \
|
|||
$(OUTDIR)/LRF_DefenderHandler.o $(OUTDIR)/LRF_Detector.o \
|
|||
$(OUTDIR)/LRF_HardwareManager.o $(OUTDIR)/LRF_Kernel.o \
|
|||
$(OUTDIR)/LRF_SafeShoreHandler.o $(OUTDIR)/LRF_Server.o \
|
|||
$(OUTDIR)/LRF_targetTracker.o $(OUTDIR)/mask.o $(OUTDIR)/md5.o \
|
|||
$(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \
|
|||
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
|
|||
$(OUTDIR)/protocolDefender.o $(OUTDIR)/protocolHTTP.o \
|
|||
$(OUTDIR)/protocolLGS.o $(OUTDIR)/protocolRGoose.o \
|
|||
$(OUTDIR)/protocolSafeShore.o $(OUTDIR)/protocolTGZ.o \
|
|||
$(OUTDIR)/pru_ss.o $(OUTDIR)/pwm_ss.o $(OUTDIR)/serverPort.o \
|
|||
$(OUTDIR)/ssdpAnnouncer.o $(OUTDIR)/transportSerial.o \
|
|||
$(OUTDIR)/transportSocket.o $(OUTDIR)/xmlParser.o |
|||
|
|||
COMPILE=g++ -c -x c++ "-D_THREAD_SAFE" "-D_BSD_SOURCE" "-D_REENTRANT" -O3 -w -Wpointer-arith -std=gnu++11 -I../../lib/include -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< |
|||
LINK=g++ -O3 -w -lconfig -lpthread -lelf -lcurses -lcdk -lcurl -s -o "$(OUTFILE)" $(ALL_OBJ) |
|||
|
|||
# Pattern rules
|
|||
$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pwmss/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/lgs/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/ssdp/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/base/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/can/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pru/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/App/3dSERVER/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/object/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/net/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/curl/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/json/%.cpp |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/transport/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pwmss/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/lgs/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/protocol/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/ssdp/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/base/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/can/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/alg/generic/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/hardware/soc/modules/pru/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/App/3dSERVER/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/components/object/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/net/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/curl/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../../lib/data/json/%.c |
|||
$(COMPILE) |
|||
|
|||
# Build rules
|
|||
all: $(OUTFILE) |
|||
|
|||
$(OUTFILE): $(OUTDIR) $(OBJ) |
|||
$(LINK) |
|||
|
|||
$(OUTDIR): |
|||
$(MKDIR) -p "$(OUTDIR)" |
|||
|
|||
# Rebuild this project
|
|||
rebuild: cleanall all |
|||
|
|||
# Clean this project
|
|||
clean: |
|||
$(RM) -f $(OUTFILE) |
|||
$(RM) -f $(OBJ) |
|||
|
|||
# Clean this project and all dependencies
|
|||
cleanall: clean |
|||
endif |
|||
Binary file not shown.
@ -0,0 +1,18 @@ |
|||
|
|||
* If you have found a bug, i.e. socat SIGSEGV'ed, terminated abnormally without |
|||
error message, did not comply to the documentation, or behaves different from |
|||
your expectations, please send the following infos to socat@dest-unreach.org, |
|||
as available: |
|||
. output of "make info" in socat.out (you may remove the hostname in the first |
|||
line to keep your privacy) |
|||
. config.log |
|||
. run your example with "socat -d -d -d -d -D ..." options, and include the log |
|||
output |
|||
. describe what you've done, and why you think socat did wrong |
|||
|
|||
* If you fixed a bug: |
|||
Please do as described in the above paragraph, and include the modified files |
|||
(or a patch file) |
|||
|
|||
* If you have contributions, problems etc: send available info and a |
|||
description to the above address. |
|||
1800
lib/hardware/socat-1.7.3.4/CHANGES
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,339 @@ |
|||
GNU GENERAL PUBLIC LICENSE |
|||
Version 2, June 1991 |
|||
|
|||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., |
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|||
Everyone is permitted to copy and distribute verbatim copies |
|||
of this license document, but changing it is not allowed. |
|||
|
|||
Preamble |
|||
|
|||
The licenses for most software are designed to take away your |
|||
freedom to share and change it. By contrast, the GNU General Public |
|||
License is intended to guarantee your freedom to share and change free |
|||
software--to make sure the software is free for all its users. This |
|||
General Public License applies to most of the Free Software |
|||
Foundation's software and to any other program whose authors commit to |
|||
using it. (Some other Free Software Foundation software is covered by |
|||
the GNU Lesser General Public License instead.) You can apply it to |
|||
your programs, too. |
|||
|
|||
When we speak of free software, we are referring to freedom, not |
|||
price. Our General Public Licenses are designed to make sure that you |
|||
have the freedom to distribute copies of free software (and charge for |
|||
this service if you wish), that you receive source code or can get it |
|||
if you want it, that you can change the software or use pieces of it |
|||
in new free programs; and that you know you can do these things. |
|||
|
|||
To protect your rights, we need to make restrictions that forbid |
|||
anyone to deny you these rights or to ask you to surrender the rights. |
|||
These restrictions translate to certain responsibilities for you if you |
|||
distribute copies of the software, or if you modify it. |
|||
|
|||
For example, if you distribute copies of such a program, whether |
|||
gratis or for a fee, you must give the recipients all the rights that |
|||
you have. You must make sure that they, too, receive or can get the |
|||
source code. And you must show them these terms so they know their |
|||
rights. |
|||
|
|||
We protect your rights with two steps: (1) copyright the software, and |
|||
(2) offer you this license which gives you legal permission to copy, |
|||
distribute and/or modify the software. |
|||
|
|||
Also, for each author's protection and ours, we want to make certain |
|||
that everyone understands that there is no warranty for this free |
|||
software. If the software is modified by someone else and passed on, we |
|||
want its recipients to know that what they have is not the original, so |
|||
that any problems introduced by others will not reflect on the original |
|||
authors' reputations. |
|||
|
|||
Finally, any free program is threatened constantly by software |
|||
patents. We wish to avoid the danger that redistributors of a free |
|||
program will individually obtain patent licenses, in effect making the |
|||
program proprietary. To prevent this, we have made it clear that any |
|||
patent must be licensed for everyone's free use or not licensed at all. |
|||
|
|||
The precise terms and conditions for copying, distribution and |
|||
modification follow. |
|||
|
|||
GNU GENERAL PUBLIC LICENSE |
|||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|||
|
|||
0. This License applies to any program or other work which contains |
|||
a notice placed by the copyright holder saying it may be distributed |
|||
under the terms of this General Public License. The "Program", below, |
|||
refers to any such program or work, and a "work based on the Program" |
|||
means either the Program or any derivative work under copyright law: |
|||
that is to say, a work containing the Program or a portion of it, |
|||
either verbatim or with modifications and/or translated into another |
|||
language. (Hereinafter, translation is included without limitation in |
|||
the term "modification".) Each licensee is addressed as "you". |
|||
|
|||
Activities other than copying, distribution and modification are not |
|||
covered by this License; they are outside its scope. The act of |
|||
running the Program is not restricted, and the output from the Program |
|||
is covered only if its contents constitute a work based on the |
|||
Program (independent of having been made by running the Program). |
|||
Whether that is true depends on what the Program does. |
|||
|
|||
1. You may copy and distribute verbatim copies of the Program's |
|||
source code as you receive it, in any medium, provided that you |
|||
conspicuously and appropriately publish on each copy an appropriate |
|||
copyright notice and disclaimer of warranty; keep intact all the |
|||
notices that refer to this License and to the absence of any warranty; |
|||
and give any other recipients of the Program a copy of this License |
|||
along with the Program. |
|||
|
|||
You may charge a fee for the physical act of transferring a copy, and |
|||
you may at your option offer warranty protection in exchange for a fee. |
|||
|
|||
2. You may modify your copy or copies of the Program or any portion |
|||
of it, thus forming a work based on the Program, and copy and |
|||
distribute such modifications or work under the terms of Section 1 |
|||
above, provided that you also meet all of these conditions: |
|||
|
|||
a) You must cause the modified files to carry prominent notices |
|||
stating that you changed the files and the date of any change. |
|||
|
|||
b) You must cause any work that you distribute or publish, that in |
|||
whole or in part contains or is derived from the Program or any |
|||
part thereof, to be licensed as a whole at no charge to all third |
|||
parties under the terms of this License. |
|||
|
|||
c) If the modified program normally reads commands interactively |
|||
when run, you must cause it, when started running for such |
|||
interactive use in the most ordinary way, to print or display an |
|||
announcement including an appropriate copyright notice and a |
|||
notice that there is no warranty (or else, saying that you provide |
|||
a warranty) and that users may redistribute the program under |
|||
these conditions, and telling the user how to view a copy of this |
|||
License. (Exception: if the Program itself is interactive but |
|||
does not normally print such an announcement, your work based on |
|||
the Program is not required to print an announcement.) |
|||
|
|||
These requirements apply to the modified work as a whole. If |
|||
identifiable sections of that work are not derived from the Program, |
|||
and can be reasonably considered independent and separate works in |
|||
themselves, then this License, and its terms, do not apply to those |
|||
sections when you distribute them as separate works. But when you |
|||
distribute the same sections as part of a whole which is a work based |
|||
on the Program, the distribution of the whole must be on the terms of |
|||
this License, whose permissions for other licensees extend to the |
|||
entire whole, and thus to each and every part regardless of who wrote it. |
|||
|
|||
Thus, it is not the intent of this section to claim rights or contest |
|||
your rights to work written entirely by you; rather, the intent is to |
|||
exercise the right to control the distribution of derivative or |
|||
collective works based on the Program. |
|||
|
|||
In addition, mere aggregation of another work not based on the Program |
|||
with the Program (or with a work based on the Program) on a volume of |
|||
a storage or distribution medium does not bring the other work under |
|||
the scope of this License. |
|||
|
|||
3. You may copy and distribute the Program (or a work based on it, |
|||
under Section 2) in object code or executable form under the terms of |
|||
Sections 1 and 2 above provided that you also do one of the following: |
|||
|
|||
a) Accompany it with the complete corresponding machine-readable |
|||
source code, which must be distributed under the terms of Sections |
|||
1 and 2 above on a medium customarily used for software interchange; or, |
|||
|
|||
b) Accompany it with a written offer, valid for at least three |
|||
years, to give any third party, for a charge no more than your |
|||
cost of physically performing source distribution, a complete |
|||
machine-readable copy of the corresponding source code, to be |
|||
distributed under the terms of Sections 1 and 2 above on a medium |
|||
customarily used for software interchange; or, |
|||
|
|||
c) Accompany it with the information you received as to the offer |
|||
to distribute corresponding source code. (This alternative is |
|||
allowed only for noncommercial distribution and only if you |
|||
received the program in object code or executable form with such |
|||
an offer, in accord with Subsection b above.) |
|||
|
|||
The source code for a work means the preferred form of the work for |
|||
making modifications to it. For an executable work, complete source |
|||
code means all the source code for all modules it contains, plus any |
|||
associated interface definition files, plus the scripts used to |
|||
control compilation and installation of the executable. However, as a |
|||
special exception, the source code distributed need not include |
|||
anything that is normally distributed (in either source or binary |
|||
form) with the major components (compiler, kernel, and so on) of the |
|||
operating system on which the executable runs, unless that component |
|||
itself accompanies the executable. |
|||
|
|||
If distribution of executable or object code is made by offering |
|||
access to copy from a designated place, then offering equivalent |
|||
access to copy the source code from the same place counts as |
|||
distribution of the source code, even though third parties are not |
|||
compelled to copy the source along with the object code. |
|||
|
|||
4. You may not copy, modify, sublicense, or distribute the Program |
|||
except as expressly provided under this License. Any attempt |
|||
otherwise to copy, modify, sublicense or distribute the Program is |
|||
void, and will automatically terminate your rights under this License. |
|||
However, parties who have received copies, or rights, from you under |
|||
this License will not have their licenses terminated so long as such |
|||
parties remain in full compliance. |
|||
|
|||
5. You are not required to accept this License, since you have not |
|||
signed it. However, nothing else grants you permission to modify or |
|||
distribute the Program or its derivative works. These actions are |
|||
prohibited by law if you do not accept this License. Therefore, by |
|||
modifying or distributing the Program (or any work based on the |
|||
Program), you indicate your acceptance of this License to do so, and |
|||
all its terms and conditions for copying, distributing or modifying |
|||
the Program or works based on it. |
|||
|
|||
6. Each time you redistribute the Program (or any work based on the |
|||
Program), the recipient automatically receives a license from the |
|||
original licensor to copy, distribute or modify the Program subject to |
|||
these terms and conditions. You may not impose any further |
|||
restrictions on the recipients' exercise of the rights granted herein. |
|||
You are not responsible for enforcing compliance by third parties to |
|||
this License. |
|||
|
|||
7. If, as a consequence of a court judgment or allegation of patent |
|||
infringement or for any other reason (not limited to patent issues), |
|||
conditions are imposed on you (whether by court order, agreement or |
|||
otherwise) that contradict the conditions of this License, they do not |
|||
excuse you from the conditions of this License. If you cannot |
|||
distribute so as to satisfy simultaneously your obligations under this |
|||
License and any other pertinent obligations, then as a consequence you |
|||
may not distribute the Program at all. For example, if a patent |
|||
license would not permit royalty-free redistribution of the Program by |
|||
all those who receive copies directly or indirectly through you, then |
|||
the only way you could satisfy both it and this License would be to |
|||
refrain entirely from distribution of the Program. |
|||
|
|||
If any portion of this section is held invalid or unenforceable under |
|||
any particular circumstance, the balance of the section is intended to |
|||
apply and the section as a whole is intended to apply in other |
|||
circumstances. |
|||
|
|||
It is not the purpose of this section to induce you to infringe any |
|||
patents or other property right claims or to contest validity of any |
|||
such claims; this section has the sole purpose of protecting the |
|||
integrity of the free software distribution system, which is |
|||
implemented by public license practices. Many people have made |
|||
generous contributions to the wide range of software distributed |
|||
through that system in reliance on consistent application of that |
|||
system; it is up to the author/donor to decide if he or she is willing |
|||
to distribute software through any other system and a licensee cannot |
|||
impose that choice. |
|||
|
|||
This section is intended to make thoroughly clear what is believed to |
|||
be a consequence of the rest of this License. |
|||
|
|||
8. If the distribution and/or use of the Program is restricted in |
|||
certain countries either by patents or by copyrighted interfaces, the |
|||
original copyright holder who places the Program under this License |
|||
may add an explicit geographical distribution limitation excluding |
|||
those countries, so that distribution is permitted only in or among |
|||
countries not thus excluded. In such case, this License incorporates |
|||
the limitation as if written in the body of this License. |
|||
|
|||
9. The Free Software Foundation may publish revised and/or new versions |
|||
of the General Public License from time to time. Such new versions will |
|||
be similar in spirit to the present version, but may differ in detail to |
|||
address new problems or concerns. |
|||
|
|||
Each version is given a distinguishing version number. If the Program |
|||
specifies a version number of this License which applies to it and "any |
|||
later version", you have the option of following the terms and conditions |
|||
either of that version or of any later version published by the Free |
|||
Software Foundation. If the Program does not specify a version number of |
|||
this License, you may choose any version ever published by the Free Software |
|||
Foundation. |
|||
|
|||
10. If you wish to incorporate parts of the Program into other free |
|||
programs whose distribution conditions are different, write to the author |
|||
to ask for permission. For software which is copyrighted by the Free |
|||
Software Foundation, write to the Free Software Foundation; we sometimes |
|||
make exceptions for this. Our decision will be guided by the two goals |
|||
of preserving the free status of all derivatives of our free software and |
|||
of promoting the sharing and reuse of software generally. |
|||
|
|||
NO WARRANTY |
|||
|
|||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
|||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
|||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
|||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
|||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
|||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
|||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
|||
REPAIR OR CORRECTION. |
|||
|
|||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
|||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
|||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
|||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
|||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
|||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
|||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
|||
POSSIBILITY OF SUCH DAMAGES. |
|||
|
|||
END OF TERMS AND CONDITIONS |
|||
|
|||
How to Apply These Terms to Your New Programs |
|||
|
|||
If you develop a new program, and you want it to be of the greatest |
|||
possible use to the public, the best way to achieve this is to make it |
|||
free software which everyone can redistribute and change under these terms. |
|||
|
|||
To do so, attach the following notices to the program. It is safest |
|||
to attach them to the start of each source file to most effectively |
|||
convey the exclusion of warranty; and each file should have at least |
|||
the "copyright" line and a pointer to where the full notice is found. |
|||
|
|||
<one line to give the program's name and a brief idea of what it does.> |
|||
Copyright (C) <year> <name of author> |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program 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 General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License along |
|||
with this program; if not, write to the Free Software Foundation, Inc., |
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|||
|
|||
Also add information on how to contact you by electronic and paper mail. |
|||
|
|||
If the program is interactive, make it output a short notice like this |
|||
when it starts in an interactive mode: |
|||
|
|||
Gnomovision version 69, Copyright (C) year name of author |
|||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|||
This is free software, and you are welcome to redistribute it |
|||
under certain conditions; type `show c' for details. |
|||
|
|||
The hypothetical commands `show w' and `show c' should show the appropriate |
|||
parts of the General Public License. Of course, the commands you use may |
|||
be called something other than `show w' and `show c'; they could even be |
|||
mouse-clicks or menu items--whatever suits your program. |
|||
|
|||
You should also get your employer (if you work as a programmer) or your |
|||
school, if any, to sign a "copyright disclaimer" for the program, if |
|||
necessary. Here is a sample; alter the names: |
|||
|
|||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
|||
`Gnomovision' (which makes passes at compilers) written by James Hacker. |
|||
|
|||
<signature of Ty Coon>, 1 April 1989 |
|||
Ty Coon, President of Vice |
|||
|
|||
This General Public License does not permit incorporating your program into |
|||
proprietary programs. If your program is a subroutine library, you may |
|||
consider it more useful to permit linking proprietary applications with the |
|||
library. If this is what you want to do, use the GNU Lesser General |
|||
Public License instead of this License. |
|||
@ -0,0 +1,127 @@ |
|||
|
|||
LICENSE ISSUES |
|||
============== |
|||
|
|||
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of |
|||
the OpenSSL License and the original SSLeay license apply to the toolkit. |
|||
See below for the actual license texts. Actually both licenses are BSD-style |
|||
Open Source licenses. In case of any license issues related to OpenSSL |
|||
please contact openssl-core@openssl.org. |
|||
|
|||
OpenSSL License |
|||
--------------- |
|||
|
|||
/* ==================================================================== |
|||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
|||
* |
|||
* Redistribution and use in source and binary forms, with or without |
|||
* modification, are permitted provided that the following conditions |
|||
* are met: |
|||
* |
|||
* 1. Redistributions of source code must retain the above copyright |
|||
* notice, this list of conditions and the following disclaimer. |
|||
* |
|||
* 2. Redistributions in binary form must reproduce the above copyright |
|||
* notice, this list of conditions and the following disclaimer in |
|||
* the documentation and/or other materials provided with the |
|||
* distribution. |
|||
* |
|||
* 3. All advertising materials mentioning features or use of this |
|||
* software must display the following acknowledgment: |
|||
* "This product includes software developed by the OpenSSL Project |
|||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" |
|||
* |
|||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to |
|||
* endorse or promote products derived from this software without |
|||
* prior written permission. For written permission, please contact |
|||
* openssl-core@openssl.org. |
|||
* |
|||
* 5. Products derived from this software may not be called "OpenSSL" |
|||
* nor may "OpenSSL" appear in their names without prior written |
|||
* permission of the OpenSSL Project. |
|||
* |
|||
* 6. Redistributions of any form whatsoever must retain the following |
|||
* acknowledgment: |
|||
* "This product includes software developed by the OpenSSL Project |
|||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" |
|||
* |
|||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY |
|||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR |
|||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
|||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
|||
* OF THE POSSIBILITY OF SUCH DAMAGE. |
|||
* ==================================================================== |
|||
* |
|||
* This product includes cryptographic software written by Eric Young |
|||
* (eay@cryptsoft.com). This product includes software written by Tim |
|||
* Hudson (tjh@cryptsoft.com). |
|||
* |
|||
*/ |
|||
|
|||
Original SSLeay License |
|||
----------------------- |
|||
|
|||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
|||
* All rights reserved. |
|||
* |
|||
* This package is an SSL implementation written |
|||
* by Eric Young (eay@cryptsoft.com). |
|||
* The implementation was written so as to conform with Netscapes SSL. |
|||
* |
|||
* This library is free for commercial and non-commercial use as long as |
|||
* the following conditions are aheared to. The following conditions |
|||
* apply to all code found in this distribution, be it the RC4, RSA, |
|||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation |
|||
* included with this distribution is covered by the same copyright terms |
|||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). |
|||
* |
|||
* Copyright remains Eric Young's, and as such any Copyright notices in |
|||
* the code are not to be removed. |
|||
* If this package is used in a product, Eric Young should be given attribution |
|||
* as the author of the parts of the library used. |
|||
* This can be in the form of a textual message at program startup or |
|||
* in documentation (online or textual) provided with the package. |
|||
* |
|||
* Redistribution and use in source and binary forms, with or without |
|||
* modification, are permitted provided that the following conditions |
|||
* are met: |
|||
* 1. Redistributions of source code must retain the copyright |
|||
* notice, this list of conditions and the following disclaimer. |
|||
* 2. Redistributions in binary form must reproduce the above copyright |
|||
* notice, this list of conditions and the following disclaimer in the |
|||
* documentation and/or other materials provided with the distribution. |
|||
* 3. All advertising materials mentioning features or use of this software |
|||
* must display the following acknowledgement: |
|||
* "This product includes cryptographic software written by |
|||
* Eric Young (eay@cryptsoft.com)" |
|||
* The word 'cryptographic' can be left out if the rouines from the library |
|||
* being used are not cryptographic related :-). |
|||
* 4. If you include any Windows specific code (or a derivative thereof) from |
|||
* the apps directory (application code) you must include an acknowledgement: |
|||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
|||
* |
|||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
|||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
|||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|||
* SUCH DAMAGE. |
|||
* |
|||
* The licence and distribution terms for any publically available version or |
|||
* derivative of this code cannot be changed. i.e. this code cannot simply be |
|||
* copied and put under another distribution licence |
|||
* [including the GNU Public Licence.] |
|||
*/ |
|||
|
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = cc -qlanglvl=extc89 |
|||
CCOPTS = $(CCOPT) |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lbsd -lssl -lcrypto |
|||
LDFLAGS = |
|||
|
|||
INSTALL = ./install-sh -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lreadline -lssl -lcrypto |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,198 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger 2001-2009
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lssl |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE -Wall -Wno-parentheses $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE -Wall -Wno-parentheses $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h \
|
|||
Config/Makefile.AIX-5-3 Config/config.AIX-5-3.h \
|
|||
Config/Makefile.Cygwin-1-5-25 Config/config.Cygwin-1-5-25.h \
|
|||
Config/Makefile.MacOSX-10-5 Config/config.MacOSX-10-5.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = -D_LONGLONG |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lreadline -lssl |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lreadline -lssl |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = -D__DYNAMIC__ |
|||
CPPFLAGS = -I. -I/usr/local/include |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lresolv -lreadline -lssl -lcrypto |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE -L/usr/local/lib $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE -L/usr/local/lib $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lssl |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=5 |
|||
CPPFLAGS = -I. |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lutil -lreadline -lcurses -lssl -lcrypto |
|||
LDFLAGS = |
|||
|
|||
INSTALL = /usr/bin/install -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,195 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = ar |
|||
RANLIB = ranlib |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = /usr/local |
|||
exec_prefix = ${prefix} |
|||
|
|||
BINDEST = ${exec_prefix}/bin |
|||
|
|||
datarootdir = ${prefix}/share |
|||
MANDEST = ${datarootdir}/man |
|||
|
|||
srcdir = . |
|||
|
|||
|
|||
CC = gcc |
|||
CCOPTS = $(CCOPT) -Wall -Wno-parentheses |
|||
|
|||
SYSDEFS = |
|||
CPPFLAGS = -I. -I/usr/sfw/include |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = -DHAVE_CONFIG_H |
|||
LIBS = -lwrap -lrt -lsocket -lnsl -lresolv -lreadline -lcurses -L/usr/sfw/lib -lssl -lcrypto |
|||
LDFLAGS = |
|||
|
|||
INSTALL = ./install-sh -c |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
|
|||
|
|||
|
|||
#0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-rawip.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh testcert.conf |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,523 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#define HAVE_GETIPNODEBYNAME 1 |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
#define HAVE_STAT64 1 |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
#define HAVE_FSTAT64 1 |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
#define HAVE_LSTAT64 1 |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
#define HAVE_LSEEK64 1 |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
#define HAVE_TRUNCATE64 1 |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
#define HAVE_FTRUNCATE64 1 |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
#define HAVE_SYS_STROPTS_H 1 |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
/* #undef HAVE_READLINE_READLINE_H */ |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
/* #undef HAVE_READLINE_HISTORY_H */ |
|||
|
|||
/* Define if you have the readline library. */ |
|||
/* #undef HAVE_LIBREADLINE */ |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
/* #undef HAVE_TERMIOS_ISPEED */ |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
/* #undef ISPEED_OFFSET */ |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
/* #undef HAVE_FLOCK */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
/* #undef HAVE_OPENPTY */ |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTMX */ |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTC 1 |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
#define HAVE_TYPE_STAT64 1 |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
#define HAVE_TYPE_OFF64 1 |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT 8 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT 10 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 4 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
/* #undef HAVE_HOSTS_ALLOW_TABLE */ |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_MODE_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_PID_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_UID_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_GID_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_TIME_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST_INO 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST_NLINK 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST_SIZE 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_TYPEOF_ST64_DEV 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST64_INO 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST64_NLINK 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST64_SIZE 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST64_BLKSIZE 0 /* unknown, taking default */ |
|||
#define HAVE_TYPEOF_ST64_BLOCKS 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 0 /* unknown, taking default */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
#define HAVE_PROC_DIR_FD 1 |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
#define WITH_SCTP 1 |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
/* #undef WITH_READLINE */ |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
/* #undef WITH_LIBWRAP */ |
|||
/* #undef HAVE_TCPD_H */ |
|||
/* #undef HAVE_LIBWRAP */ |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
/* #undef HAVE_GETADDRINFO */ |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
/* #undef HAVE_GETIPNODEBYNAME */ |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
/* #undef HAVE_IF_INDEXTONAME */ |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
/* #undef HAVE_STAT64 */ |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
/* #undef HAVE_FSTAT64 */ |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
/* #undef HAVE_LSTAT64 */ |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
#define HAVE_PTY_H 1 |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
/* #undef HAVE_NETINET_IP6_H */ |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
/* #undef HAVE_ARPA_NAMESER_H */ |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
/* #undef HAVE_RESOLV_H */ |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
/* #undef HAVE_NET_IF_DL_H */ |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
/* #undef HAVE_STRUCT_IPV6_MREQ */ |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
/* #undef HAVE_STRUCT_SOCKADDR_SALEN */ |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
/* #undef HAVE_IP6_SOCKADDR */ |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
/* #undef HAVE_TYPE_STAT64 */ |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT 7 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT 11 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 4 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 6 /* unsigned long */ |
|||
#define HAVE_BASIC_GID_T 6 /* unsigned long */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 3 /* int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST_NLINK 2 /* unsigned short */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
/* #undef HAVE_TYPEOF_ST64_DEV */ |
|||
/* #undef HAVE_TYPEOF_ST64_INO */ |
|||
/* #undef HAVE_TYPEOF_ST64_NLINK */ |
|||
/* #undef HAVE_TYPEOF_ST64_SIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLKSIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLOCKS */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 6 /* unsigned long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
#define HAVE_PROC_DIR_FD 1 |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
/* #undef WITH_IP6 */ |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
/* #undef WITH_SCTP */ |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,545 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger 2001-2011 */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#define HAVE_GETIPNODEBYNAME 1 |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
#define HAVE_MEMRCHR 1 |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
/* #undef HAVE_STAT64 */ |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
/* #undef HAVE_FSTAT64 */ |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
/* #undef HAVE_LSTAT64 */ |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <inttypes.h> header file. */ |
|||
#define HAVE_INTTYPES_H 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <netinet6/in6.h> header file. */ |
|||
/* #undef HAVE_NETINET6_IN6_H */ |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <bsd/libutil.h> header file. */ |
|||
/* #undef HAVE_BSD_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
#define HAVE_LIBUTIL_H 1 |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
/* #undef HAVE_READLINE_READLINE_H */ |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
/* #undef HAVE_READLINE_HISTORY_H */ |
|||
|
|||
/* Define if you have the readline library. */ |
|||
/* #undef HAVE_LIBREADLINE */ |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
#define HAVE_STRUCT_IFREQ_IFR_INDEX 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct in_pktinfo has component ipi_spec_dst */ |
|||
/* #undef HAVE_PKTINFO_IPI_SPEC_DST */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the SSLv2_client_method function. not in new openssl */ |
|||
/* #undef HAVE_SSLv2_client_method */ |
|||
|
|||
/* Define if you have the SSLv2_server_method function. not in new openssl */ |
|||
#define HAVE_SSLv2_server_method 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
/* #undef HAVE_TYPE_STAT64 */ |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 8 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 2 /* unsigned short */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF_T 7 /* long long */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
#define HAVE_BASIC_DEV_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST_NLINK 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
/* #undef HAVE_TYPEOF_ST64_DEV */ |
|||
/* #undef HAVE_TYPEOF_ST64_INO */ |
|||
/* #undef HAVE_TYPEOF_ST64_NLINK */ |
|||
/* #undef HAVE_TYPEOF_ST64_SIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLKSIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLOCKS */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 7 /* long long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
/* #undef HAVE_PROC_DIR_FD */ |
|||
|
|||
#define HAVE_SETGRENT 1 |
|||
#define HAVE_GETGRENT 1 |
|||
#define HAVE_ENDGRENT 1 |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
#define WITH_SCTP 1 |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
/* #undef WITH_READLINE */ |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#define HAVE_GETIPNODEBYNAME 1 |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
/* #undef HAVE_STAT64 */ |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
/* #undef HAVE_FSTAT64 */ |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
/* #undef HAVE_LSTAT64 */ |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
#define HAVE_LIBUTIL_H 1 |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
#define HAVE_STRUCT_IFREQ_IFR_INDEX 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTMX */ |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
/* #undef HAVE_TYPE_STAT64 */ |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 8 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 2 /* unsigned short */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 3 /* int */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_INO 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_NLINK 2 /* unsigned short */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
/* #undef HAVE_TYPEOF_ST64_DEV */ |
|||
/* #undef HAVE_TYPEOF_ST64_INO */ |
|||
/* #undef HAVE_TYPEOF_ST64_NLINK */ |
|||
/* #undef HAVE_TYPEOF_ST64_SIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLKSIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLOCKS */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 7 /* long long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
/* #undef HAVE_PROC_DIR_FD */ |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
#define WITH_SCTP 1 |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
/* #undef HAVE_GETIPNODEBYNAME */ |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
#define HAVE_MEMRCHR 1 |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
#define HAVE_STAT64 1 |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
#define HAVE_FSTAT64 1 |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
#define HAVE_LSTAT64 1 |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
#define HAVE_LSEEK64 1 |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
#define HAVE_TRUNCATE64 1 |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
#define HAVE_FTRUNCATE64 1 |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
#define HAVE_PTY_H 1 |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
/* #undef HAVE_NET_IF_DL_H */ |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
#define HAVE_LINUX_TYPES_H 1 |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
#define HAVE_LINUX_ERRQUEUE_H 1 |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
#define HAVE_LINUX_IF_TUN_H 1 |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
#define HAVE_NETPACKET_PACKET_H 1 |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
#define HAVE_NETINET_IF_ETHER_H 1 |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
#define HAVE_SYS_STROPTS_H 1 |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
#define HAVE_LINUX_FS_H 1 |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
#define HAVE_LINUX_EXT2_FS_H 1 |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 13 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
#define HAVE_STRUCT_IP_MREQN 1 |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
#define HAVE_STRUCT_IFREQ_IFR_IFINDEX 1 |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
/* #undef HAVE_STRUCT_SOCKADDR_SALEN */ |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
#define HAVE_STRUCT_IN_PKTINFO 1 |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
#define HAVE_TYPE_STAT64 1 |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
#define HAVE_TYPE_OFF64 1 |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
#define HAVE_TYPE_SIGHANDLER 1 |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
#define HAVE_FORMAT_Z 1 |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT 9 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT 11 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 4 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF64_T 7 /* long long */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST_INO 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST_NLINK 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_SIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_ST64_DEV 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST64_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST64_NLINK 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST64_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST64_BLKSIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST64_BLOCKS 7 /* long long */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 6 /* unsigned long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
#define HAVE_PROC_DIR_FD 1 |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
#define WITH_ABSTRACT_UNIXSOCKET 1 |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
#define WITH_INTERFACE 1 |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
#define WITH_SCTP 1 |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
#define WITH_TUN 1 |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#define HAVE_GETIPNODEBYNAME 1 |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
#define HAVE_STAT64 1 |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
#define HAVE_FSTAT64 1 |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
#define HAVE_LSTAT64 1 |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
#define HAVE_UTIL_H 1 |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
#define HAVE_TYPE_STAT64 1 |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT 12 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 8 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 6 /* unsigned long */ |
|||
#define HAVE_BASIC_MODE_T 2 /* unsigned short */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 3 /* int */ |
|||
#define HAVE_TYPEOF_ST_INO 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_NLINK 2 /* unsigned short */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 3 /* int */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
#define HAVE_TYPEOF_ST64_DEV 3 /* int */ |
|||
#define HAVE_TYPEOF_ST64_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST64_NLINK 2 /* unsigned short */ |
|||
#define HAVE_TYPEOF_ST64_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST64_BLKSIZE 3 /* int */ |
|||
#define HAVE_TYPEOF_ST64_BLOCKS 7 /* long long */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 3 /* int */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 8 /* unsigned long long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
/* #undef HAVE_PROC_DIR */ |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
/* #undef HAVE_PROC_DIR_FD */ |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
/* #undef WITH_SCTP */ |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
/* #undef HAVE_GETIPNODEBYNAME */ |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
/* #undef HAVE_STAT64 */ |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
/* #undef HAVE_FSTAT64 */ |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
/* #undef HAVE_LSTAT64 */ |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
#define HAVE_UTIL_H 1 |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
/* #undef HAVE_READLINE_READLINE_H */ |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
/* #undef HAVE_READLINE_HISTORY_H */ |
|||
|
|||
/* Define if you have the readline library. */ |
|||
/* #undef HAVE_LIBREADLINE */ |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
/* #undef HAVE_TYPE_STAT64 */ |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 8 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST_NLINK 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
/* #undef HAVE_TYPEOF_ST64_DEV */ |
|||
/* #undef HAVE_TYPEOF_ST64_INO */ |
|||
/* #undef HAVE_TYPEOF_ST64_NLINK */ |
|||
/* #undef HAVE_TYPEOF_ST64_SIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLKSIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLOCKS */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 7 /* long long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
/* #undef HAVE_PROC_DIR_FD */ |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
/* #undef WITH_SCTP */ |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
/* #undef WITH_READLINE */ |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
/* #undef HAVE_GETIPNODEBYNAME */ |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
#define HAVE_MEMRCHR 1 |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
/* #undef HAVE_STAT64 */ |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
/* #undef HAVE_FSTAT64 */ |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
/* #undef HAVE_LSTAT64 */ |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
/* #undef HAVE_LSEEK64 */ |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
/* #undef HAVE_TRUNCATE64 */ |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
/* #undef HAVE_FTRUNCATE64 */ |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
#define HAVE_UTIL_H 1 |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
/* #undef HAVE_SYS_STROPTS_H */ |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
#define HAVE_TERMIOS_ISPEED 1 |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
#define ISPEED_OFFSET 9 |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#define HAVE_STRUCT_SOCKADDR_SALEN 1 |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
/* #undef HAVE_STRUCT_IOVEC */ |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROL 1 |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGCONTROLLEN 1 |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#define HAVE_STRUCT_MSGHDR_MSGFLAGS 1 |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
#define HAVE_FLOCK 1 |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#define HAVE_OPENPTY 1 |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
/* #undef HAVE_GRANTPT */ |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
/* #undef HAVE_UNLOCKPT */ |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
/* #undef HAVE_PTSNAME */ |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTMX */ |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
/* #undef HAVE_TYPE_STAT64 */ |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
/* #undef HAVE_TYPE_OFF64 */ |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT -1 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 8 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 6 /* unsigned long */ |
|||
#define HAVE_BASIC_MODE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_PID_T 3 /* int */ |
|||
#define HAVE_BASIC_UID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_GID_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_TIME_T 3 /* int */ |
|||
#define HAVE_BASIC_OFF64_T 0 /* unknown, taking default */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 3 /* int */ |
|||
#define HAVE_TYPEOF_ST_INO 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_NLINK 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 4 /* unsigned int */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 7 /* long long */ |
|||
|
|||
/* #undef HAVE_TYPEOF_ST64_DEV */ |
|||
/* #undef HAVE_TYPEOF_ST64_INO */ |
|||
/* #undef HAVE_TYPEOF_ST64_NLINK */ |
|||
/* #undef HAVE_TYPEOF_ST64_SIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLKSIZE */ |
|||
/* #undef HAVE_TYPEOF_ST64_BLOCKS */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 8 /* unsigned long long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
/* #undef HAVE_PROC_DIR */ |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
/* #undef HAVE_PROC_DIR_FD */ |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
/* #undef WITH_SCTP */ |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,522 @@ |
|||
/* config.h. Generated from config.h.in by configure. */ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
/* #undef const */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef gid_t */ |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#define HAVE_ST_BLKSIZE 1 |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#define HAVE_ST_BLOCKS 1 |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#define HAVE_ST_RDEV 1 |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#define HAVE_STRFTIME 1 |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#define HAVE_SYS_WAIT_H 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef mode_t */ |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
/* #undef off_t */ |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef pid_t */ |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#define RETSIGTYPE void |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
/* #undef size_t */ |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#define STDC_HEADERS 1 |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#define TIME_WITH_SYS_TIME 1 |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
/* #undef uid_t */ |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#define HAVE_PUTENV 1 |
|||
|
|||
/* Define if you have the select function. */ |
|||
#define HAVE_SELECT 1 |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#define HAVE_POLL 1 |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#define HAVE_SOCKET 1 |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#define HAVE_STRDUP 1 |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#define HAVE_STRERROR 1 |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#define HAVE_STRSTR 1 |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#define HAVE_STRTOD 1 |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#define HAVE_STRTOL 1 |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#define HAVE_STRTOUL 1 |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#define HAVE_UNAME 1 |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#define HAVE_GETPGID 1 |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#define HAVE_GETSID 1 |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#define HAVE_NANOSLEEP 1 |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#define HAVE_GETADDRINFO 1 |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#define HAVE_GETIPNODEBYNAME 1 |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#define HAVE_SETGROUPS 1 |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#define HAVE_INET_ATON 1 |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
/* #undef HAVE_MEMRCHR */ |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#define HAVE_IF_INDEXTONAME 1 |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#define HAVE_SIGACTION 1 |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
#define HAVE_STAT64 1 |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
#define HAVE_FSTAT64 1 |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
#define HAVE_LSTAT64 1 |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
#define HAVE_LSEEK64 1 |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
#define HAVE_TRUNCATE64 1 |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
#define HAVE_FTRUNCATE64 1 |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#define HAVE_STRTOLL 1 |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#define HAVE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#define HAVE_INET_NTOP 1 |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#define HAVE_PROTOTYPE_HSTRERROR 1 |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#define HAVE_FCNTL_H 1 |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#define HAVE_LIMITS_H 1 |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#define HAVE_STRINGS_H 1 |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#define HAVE_SYS_PARAM_H 1 |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#define HAVE_SYS_IOCTL_H 1 |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#define HAVE_SYS_TIME_H 1 |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#define HAVE_SYSLOG_H 1 |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#define HAVE_UNISTD_H 1 |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#define HAVE_PWD_H 1 |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#define HAVE_GRP_H 1 |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#define HAVE_STDINT_H 1 |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#define HAVE_SYS_TYPES_H 1 |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#define HAVE_SYS_POLL_H 1 |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#define HAVE_SYS_SOCKET_H 1 |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#define HAVE_SYS_UIO_H 1 |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#define HAVE_SYS_STAT_H 1 |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#define HAVE_NETDB_H 1 |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#define HAVE_SYS_UN_H 1 |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
/* #undef HAVE_PTY_H */ |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#define HAVE_NETINET_IN_H 1 |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#define HAVE_NETINET_IN_SYSTM_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#define HAVE_NETINET_IP_H 1 |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#define HAVE_NETINET_TCP_H 1 |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#define HAVE_NETINET_IP6_H 1 |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#define HAVE_ARPA_NAMESER_H 1 |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#define HAVE_RESOLV_H 1 |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#define HAVE_TERMIOS_H 1 |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#define HAVE_NET_IF_H 1 |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#define HAVE_NET_IF_DL_H 1 |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
/* #undef HAVE_LINUX_TYPES_H */ |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
/* #undef HAVE_LINUX_ERRQUEUE_H */ |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
/* #undef HAVE_LINUX_IF_TUN_H */ |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
/* #undef HAVE_NETPACKET_PACKET_H */ |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
/* #undef HAVE_NETINET_IF_ETHER_H */ |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#define HAVE_SYS_UTSNAME_H 1 |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#define HAVE_SYS_SELECT_H 1 |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#define HAVE_SYS_FILE_H 1 |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
/* #undef HAVE_UTIL_H */ |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
/* #undef HAVE_LIBUTIL_H */ |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
#define HAVE_SYS_STROPTS_H 1 |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#define HAVE_REGEX_H 1 |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_FS_H */ |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
/* #undef HAVE_LINUX_EXT2_FS_H */ |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#define HAVE_READLINE_READLINE_H 1 |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#define HAVE_READLINE_HISTORY_H 1 |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#define HAVE_LIBREADLINE 1 |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
/* #undef HAVE_LIBM */ |
|||
|
|||
/* Define if you have the floor function */ |
|||
/* #undef HAVE_FLOOR */ |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
/* #undef _XOPEN_EXTENDED_SOURCE */ |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#define HAVE_FDS_BITS 1 |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#define HAVE_TYPE_SA_FAMILY_T 1 |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 |
|||
|
|||
/* Define if your struct termios has component c_ispeed */ |
|||
/* #undef HAVE_TERMIOS_ISPEED */ |
|||
|
|||
/* the offset of c_ispeed in struct termios - usable in an speed_t array. |
|||
Applies only when HAVE_TERMIOS_ISPEED is set */ |
|||
/* #undef ISPEED_OFFSET */ |
|||
|
|||
/* the offset of c_ospeed in struct termios - see ISPEED_OFFSET */ |
|||
#ifdef ISPEED_OFFSET |
|||
# define OSPEED_OFFSET (ISPEED_OFFSET+1) |
|||
#else |
|||
/* # undef OSPEED_OFFSET */ |
|||
#endif |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
/* #undef _SVID3 */ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#define HAVE_STRUCT_TIMESPEC 1 |
|||
|
|||
/* Define if you have struct linger */ |
|||
#define HAVE_STRUCT_LINGER 1 |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#define HAVE_STRUCT_IP_MREQ 1 |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
/* #undef HAVE_STRUCT_IP_MREQN */ |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#define HAVE_STRUCT_IPV6_MREQ 1 |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#define HAVE_STRUCT_IFREQ 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
#define HAVE_STRUCT_IFREQ_IFR_INDEX 1 |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
/* #undef HAVE_STRUCT_IFREQ_IFR_IFINDEX */ |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
/* #undef HAVE_STRUCT_SOCKADDR_SALEN */ |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#define HAVE_IP6_SOCKADDR 0 |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#define HAVE_STRUCT_IOVEC 1 |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
/* #undef HAVE_STRUCT_MSGHDR_MSGCONTROL */ |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
/* #undef HAVE_STRUCT_MSGHDR_MSGCONTROLLEN */ |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
/* #undef HAVE_STRUCT_MSGHDR_MSGFLAGS */ |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#define HAVE_STRUCT_CMSGHDR 1 |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
/* #undef HAVE_STRUCT_IN_PKTINFO */ |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#define HAVE_STRUCT_IP_IP_HL 1 |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#define HAVE_SETENV 1 |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#define HAVE_UNSETENV 1 |
|||
|
|||
/* Define if you have the flock function */ |
|||
/* #undef HAVE_FLOCK */ |
|||
|
|||
/* Define if you have the openpty function */ |
|||
/* #undef HAVE_OPENPTY */ |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#define HAVE_GRANTPT 1 |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#define HAVE_UNLOCKPT 1 |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#define HAVE_PTSNAME 1 |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#define HAVE_DEV_PTMX 1 |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
/* #undef HAVE_DEV_PTC */ |
|||
|
|||
/* Define if you have the long long type */ |
|||
#define HAVE_TYPE_LONGLONG 1 |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#define HAVE_TYPE_SOCKLEN 1 |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
#define HAVE_TYPE_STAT64 1 |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
#define HAVE_TYPE_OFF64 1 |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
/* #undef HAVE_TYPE_SIGHANDLER */ |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#define HAVE_TYPE_UINT8 1 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#define HAVE_TYPE_UINT16 1 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#define HAVE_TYPE_UINT32 1 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#define HAVE_TYPE_UINT64 1 |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
/* #undef HAVE_FORMAT_Z */ |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#define CRDLY_SHIFT 9 |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#define TABDLY_SHIFT 11 |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#define CSIZE_SHIFT 4 |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#define HAVE_HOSTS_ALLOW_TABLE 1 |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
/* # undef HAVE_HOSTS_DENY_TABLE */ |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#define HAVE_BASIC_SIZE_T 4 /* unsigned int */ |
|||
#define HAVE_BASIC_MODE_T 6 /* unsigned long */ |
|||
#define HAVE_BASIC_PID_T 5 /* long */ |
|||
#define HAVE_BASIC_UID_T 5 /* long */ |
|||
#define HAVE_BASIC_GID_T 5 /* long */ |
|||
#define HAVE_BASIC_TIME_T 5 /* long */ |
|||
#define HAVE_BASIC_OFF64_T 7 /* long long */ |
|||
|
|||
#define HAVE_BASIC_SOCKLEN_T 4 /* unsigned int */ |
|||
|
|||
#define HAVE_TYPEOF_ST_DEV 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST_INO 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST_NLINK 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST_SIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST_BLKSIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST_BLOCKS 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_ST64_DEV 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST64_INO 8 /* unsigned long long */ |
|||
#define HAVE_TYPEOF_ST64_NLINK 6 /* unsigned long */ |
|||
#define HAVE_TYPEOF_ST64_SIZE 7 /* long long */ |
|||
#define HAVE_TYPEOF_ST64_BLKSIZE 5 /* long */ |
|||
#define HAVE_TYPEOF_ST64_BLOCKS 7 /* long long */ |
|||
|
|||
#define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 /* long */ |
|||
|
|||
#define HAVE_TYPEOF_RLIM_MAX 6 /* unsigned long */ |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#define HAVE_PROC_DIR 1 |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
#define HAVE_PROC_DIR_FD 1 |
|||
|
|||
#define WITH_HELP 1 |
|||
#define WITH_STDIO 1 |
|||
#define WITH_FDNUM 1 |
|||
#define WITH_FILE 1 |
|||
#define WITH_CREAT 1 |
|||
#define WITH_GOPEN 1 |
|||
#define WITH_TERMIOS 1 |
|||
#define WITH_PIPE 1 |
|||
#define WITH_UNIX 1 |
|||
/* #undef WITH_ABSTRACT_UNIXSOCKET */ |
|||
#define WITH_IP4 1 |
|||
#define WITH_IP6 1 |
|||
#define WITH_RAWIP 1 |
|||
#define WITH_GENERICSOCKET 1 |
|||
/* #undef WITH_INTERFACE */ |
|||
#define WITH_TCP 1 |
|||
#define WITH_UDP 1 |
|||
#define WITH_SCTP 1 |
|||
#define WITH_LISTEN 1 |
|||
#define WITH_SOCKS4 1 |
|||
#define WITH_SOCKS4A 1 |
|||
#define WITH_PROXY 1 |
|||
#define WITH_EXEC 1 |
|||
#define WITH_SYSTEM 1 |
|||
#define WITH_READLINE 1 |
|||
/* #undef WITH_TUN */ |
|||
#define WITH_PTY 1 |
|||
#define WITH_EXT2 1 |
|||
#define WITH_OPENSSL 1 |
|||
#define WITH_STREAMS 1 |
|||
/* #undef WITH_FIPS */ |
|||
/* #undef OPENSSL_FIPS */ |
|||
#define WITH_LIBWRAP 1 |
|||
#define HAVE_TCPD_H 1 |
|||
#define HAVE_LIBWRAP 1 |
|||
|
|||
#define WITH_SYCLS 1 |
|||
#define WITH_FILAN 1 |
|||
#define WITH_RETRY 1 |
|||
|
|||
#define WITH_MSGLEVEL 0 |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
@ -0,0 +1,222 @@ |
|||
|
|||
This file should help you to add new address types and address options to |
|||
socat. |
|||
|
|||
NOTE: |
|||
socat will in future releases be split into a library "libxio" containing all |
|||
the address stuff, useful also for many other purposes, and the socat main() |
|||
and data shuffler. If you intend to perform major changes to the xio part and |
|||
to publish them, please contact me before! |
|||
|
|||
|
|||
ADDING A NEW ADDRESS TYPE: |
|||
|
|||
* Create new files xio-newaddr.c and xio-newaddr.h |
|||
|
|||
* Create a new record of struct addrdesc in xio-newaddr.c, with declaration in xio-newaddr.h. |
|||
|
|||
* Make a new entry to addressnames[] in xioopen.c with the addresses main name |
|||
and maybe with alias names. Keep this array ASCII sorted, without uppercase |
|||
chars. |
|||
|
|||
* config.h.in: #undef WITH_NEWADDR |
|||
|
|||
* configure.in: Copy the disable part of, e.g., WITH_SOCKS4 and adapt it to |
|||
NEWADDR |
|||
|
|||
* In socat.c, add to socat_version |
|||
|
|||
* Write a function xioopen_newaddr() in xio-newaddr.c, declaration in |
|||
xio-newaddr.h |
|||
Do not forget the following option processing calls: |
|||
All groups: _xio_openlate() |
|||
Group FD: applyopts_cloexec() |
|||
Group NAMED: applyopts_file() for phases PREOPEN, OPEN, and FD |
|||
|
|||
* Describe a tested example in file EXAMPLES, and maybe in the socat manpage |
|||
source. |
|||
|
|||
* Try to define a test for this address type in test.sh |
|||
|
|||
* Update file CHANGES |
|||
|
|||
|
|||
ADDING A NEW ADDRESS OPTION: |
|||
|
|||
xioopen.c: |
|||
|
|||
* If this option depends on a #define that is probably not available on all |
|||
platforms, make all new code for this option dependent on the existence of this |
|||
C header define: |
|||
#ifdef PREFIX_NEWOPTION |
|||
... |
|||
#endif |
|||
|
|||
* Add an OPT_NEWOPTION to enum e_optcode in xioopts.h, preferably keeping |
|||
alphabetic order |
|||
|
|||
* Add a struct optdesc opt_newoption record in xio-newaddr.c and its |
|||
declaration in xio-newaddr.h. The complete structure definition must be in one |
|||
line without breaks for automatic docu extraction. |
|||
Build the record from the following components: |
|||
. A canonical default name (e.g. "newoption") |
|||
. A short, preferable name (e.g. "newopt") or NULL |
|||
. OPT_NEWOPTION (from enum e_optcode, see above) |
|||
. A group membership that restricts appliance of the new option to matching |
|||
address types (e.g., one of GROUP_ANY, GROUP_IP_TCP, GROUP_EXEC) |
|||
. A phase specification that positions this option within address processing. |
|||
Note that the function code can override this value. |
|||
. A representation type for option arguments (e.g., TYPE_INT, TYPE_STRING etc.; |
|||
use TYPE_BOOL if this option just triggers an action) |
|||
. A function or action definition for applying this option. If it does not use |
|||
one of the standard functions (open(), ioctl(), setsockopt()...), then use |
|||
OFUNC_SPEC (specific). |
|||
|
|||
* For the canonical name and all its aliases and abbreviations, add entries to |
|||
the array optionnames in xioopts.c. KEEP STRICT ALPHABETIC (ASCII) ORDER! |
|||
The entries must be embedded in an IF_... macro of their group for conditional |
|||
compiling. |
|||
|
|||
* For options using some predefined action (see OFUNC above), this might be |
|||
enough - test the option and document it in xio.help! |
|||
For OFUNC_SPEC, it might suffice to add another "case" to the OFUNC_SPEC branch |
|||
in applyopts() in xioopts.c. If you need more special handling, you should try |
|||
to understand the address specific functions and add your code there. |
|||
|
|||
* If you use system or low level C library calls or library calls that might |
|||
hang or induce problems, please invoke them with capitalized name; if no such |
|||
name is defined, add an appropriate debug function to sycls.c, and a header |
|||
entry and a wrapper "define" to sycls.h |
|||
|
|||
* Update file CHANGES |
|||
|
|||
|
|||
INFO ABOUT ADDRESS PHASES: |
|||
|
|||
Each option entry has a field specifying a default phase for its application. |
|||
Of course, the code that analyses and applies an address may override this |
|||
default phase. |
|||
|
|||
Depending on the type of address there are several major phase sequences: |
|||
|
|||
|
|||
OPEN addresses: |
|||
|
|||
PH_INIT retrieving info from original state |
|||
PH_EARLY before any other processing |
|||
PH_PREOPEN before file creation/opening (not UNIX sockets) |
|||
PH_OPEN during file creation/opening (not UNIX sockets) |
|||
PH_PASTOPEN past file creation/opening (not UNIX sockets) |
|||
PH_FD soon after FD creation or identification |
|||
PH_LATE FD is ready, before start of data loop |
|||
PH_LATE2 FD is ready, dropping privileges |
|||
|
|||
|
|||
SOCKET addresses: |
|||
|
|||
PH_INIT retrieving info from original state |
|||
PH_EARLY before any other processing |
|||
PH_PRESOCKET before socket call |
|||
PH_SOCKET for socket call |
|||
PH_PASTSOCKET after socket call |
|||
PH_FD soon after FD creation or identification |
|||
PH_PREBIND before socket bind() |
|||
PH_BIND during socket bind() |
|||
PH_PASTBIND past socket bind() |
|||
PH_PRECONNECT before connect() |
|||
PH_CONNECT during connect() |
|||
PH_PASTCONNECT after connect() |
|||
PH_CONNECTED phase common with listen |
|||
PH_LATE FD is ready, before start of data loop |
|||
PH_LATE2 FD is ready, dropping privileges |
|||
|
|||
|
|||
SOCKET with LISTEN and ACCEPT: |
|||
|
|||
PH_INIT retrieving info from original state |
|||
PH_EARLY before any other processing |
|||
PH_PRESOCKET before socket call |
|||
PH_SOCKET for socket call |
|||
PH_PREBIND before socket bind() |
|||
PH_BIND during socket bind() |
|||
PH_PASTBIND past socket bind() |
|||
PH_PRELISTEN before listen() |
|||
PH_LISTEN during listen() |
|||
PH_PASTLISTEN after listen() |
|||
PH_PREACCEPT before accept() |
|||
PH_ACCEPT during accept() |
|||
PH_PASTACCEPT after accept() |
|||
# and the following on the new FD: |
|||
PH_FD soon after FD creation or identification |
|||
PH_PASTSOCKET after socket call |
|||
PH_CONNECTED phase common with connect |
|||
PH_PREFORK before forking |
|||
PH_FORK during fork() |
|||
PH_PASTFORK after fork() |
|||
PH_LATE FD is ready, before start of data loop |
|||
PH_LATE2 FD is ready, dropping privileges |
|||
|
|||
|
|||
FD addresses: |
|||
|
|||
PH_INIT retrieving info from original state |
|||
PH_EARLY before any other processing |
|||
PH_FD soon after FD identification |
|||
PH_LATE FD is ready, before start of data loop |
|||
PH_LATE2 FD is ready, dropping privileges |
|||
|
|||
|
|||
EXEC addresses: |
|||
|
|||
PH_INIT retrieving info from original state |
|||
PH_EARLY before any other processing |
|||
PH_PREBIGEN before socketpair() pipe() openpty() |
|||
PH_BIGEN during socketpair() pipe() openpty() |
|||
PH_PASTBIGEN past socketpair() pipe() openpty() |
|||
PH_PASTSOCKET for socketpair() |
|||
PH_FD soon after FD creation or identification |
|||
PH_PREFORK before forking |
|||
PH_FORK during fork() |
|||
PH_PASTFORK after fork() |
|||
PH_LATE FD is ready, before start of data loop |
|||
PH_LATE2 FD is ready, dropping privileges |
|||
PH_PREEXEC before exec() or system() |
|||
PH_EXEC during exec() or system() |
|||
|
|||
|
|||
There are lots of semantic relations between group, phase, and func fields of |
|||
an option. |
|||
|
|||
|
|||
There exists something like an overall phase sequence: |
|||
PH_INIT # su-d.1 |
|||
PH_EARLY # chroot-early |
|||
PH_PREOPEN, PH_OPEN, PH_PASTOPEN # (chroot before/after?) |
|||
PH_PRESOCKET, PH_SOCKET, PH_PASTSOCKET # (su after (root for raw)?) |
|||
PH_PREBIGEN, PH_BIGEN, PH_PASTBIGEN # (chroot before/after (/dev..)?) |
|||
PH_FD |
|||
PH_PREBIND, PH_BIND, PH_PASTBIND # (su after(before?)) |
|||
PH_PRELISTEN, PH_LISTEN, PH_PASTLISTEN |
|||
PH_PRECONNECT, PH_CONNECT, PH_PASTCONNECT # (chroot before/after (AF_UNIX)?) |
|||
PH_PREACCEPT, PH_ACCEPT, PH_PASTACCEPT |
|||
PH_CONNECTED |
|||
PH_PREFORK, PH_FORK, PH_PASTFORK # (all before/after?) |
|||
PH_LATE # chroot |
|||
PH_LATE2 # su, su-d.2 |
|||
PH_PREEXEC, PH_EXEC # (all before) |
|||
|
|||
=============================================================================== |
|||
// Up to 1.7.2.4 socat used non async signal safe system and library calls in signal handlers, mostly for logging purposes. This problem was fixed in release 1.7.3.0 with the following concepts: |
|||
|
|||
Signal handlers set on entry and unset on return the diag_in_handler global variable. The logging system, when this variable is set, queues the text message together with errno and exit info in a UNIX datagram socket. When invoked with unset diag_in_handler it first checks if there are messages in that queue and prints them first. |
|||
|
|||
A async signal safe but minimal version of vsnprintf, named vsnprintf_r, was written so no value arguments need to be queued. |
|||
|
|||
Because strerror is not async signal safe a new function snprinterr was written that replaces the (glibc compatible) %m format with strerror output. The original errno is passed in the message queue, snprinterr is called when dequeuing messages outside of signal handler. |
|||
|
|||
// List of signal handlers in socat |
|||
socat.c:socat_signal (generic, just logs and maybe exits) |
|||
xioshutdown.c:signal_kill_pid (SIGALRM, kill child process) |
|||
xiosigchld.c:childdied (SIGCHLD: get info, log; possibly close channel) |
|||
xiosignal.c:socatsignalpass: cascades signal to channel child processes; w/ options sighup,sigint,sigquit |
|||
xio-socket.c:xiosigaction_hasread: SIGUSR1,SIGCHLD, tells parent that datagram has been consumed |
|||
@ -0,0 +1,364 @@ |
|||
|
|||
// Examples for using socat (and filan) |
|||
|
|||
|
|||
//"$" means normal user, "#" requires privileges, "//" starts a comment |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// similar to netcat |
|||
|
|||
// connect to 10.1.1.1 on port 80 and relay to and from stdio |
|||
$ socat - TCP:10.1.1.1:80 # similar to "netcat 10.1.1.1 80" |
|||
|
|||
// listen on port 25, wait for an incoming connection, use CR+NL on this |
|||
// connection, relay data to and from stdio; |
|||
// then emulate a mailserver by hand :-) |
|||
# socat - TCP-LISTEN:25,crlf |
|||
|
|||
// listen on port 25, wait for an incoming connection, use CR+NL on this |
|||
// connection, relay data to and from stdio, but have line editing and history; |
|||
// then emulate a mailserver by hand :-) |
|||
# socat readline TCP-LISTEN:25,crlf |
|||
|
|||
// provide a transient history enabled front end to stupid line based |
|||
// interactive programs |
|||
$ socat readline exec:"nslookup",pty,ctty,setsid,echo=0 |
|||
// same works for ftp (but password is not hidden) |
|||
|
|||
// you may also use a file based history list |
|||
$ socat readline,history=.nslookup_hist exec:"nslookup",pty,ctty,setsid,echo=0 |
|||
// using ~ as abbreviation for $HOME does not work! |
|||
|
|||
// poor mans 'telnetd' replacement |
|||
# socat tcp-l:2023,reuseaddr,fork exec:/bin/login,pty,setsid,setpgid,stderr,ctty |
|||
// and here an appropriate client: |
|||
$ socat -,raw,echo=0 tcp:172.16.181.130:2023 |
|||
// use ssl with client and server certificate for improved security; |
|||
// replace /bin/login by /bin/bash when using SSL client authentication, can be |
|||
// run without root then |
|||
|
|||
// this is a cool trick, proposed by Christophe Lohr, to dump communications to |
|||
// two files; it would also work for other manipulations (recode, compress...) |
|||
// and it might also work with netcat ;-) |
|||
$ socat TCP-LISTEN:5555 SYSTEM:'tee l2r | socat - "TCP:remote:5555" | tee r2l' |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// emergence solution because usleep(1) is not always available |
|||
// this will "sleep" for 0.1s |
|||
$ socat -T 0.1 pipe pipe |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// a very primitive HTTP/1.0 echo server (problems: sends reply headers before |
|||
// request; hangs if client does not shutdown - HTTP keep-alive) |
|||
// wait for a connection on port 8000; do not wait for request, but immediately |
|||
// start a shell that sends reply headers and an empty line; then echo all |
|||
// incoming data back to client |
|||
$ socat TCP-LISTEN:8000,crlf SYSTEM:"echo HTTP/1.0 200; echo Content-Type\: text/plain; echo; cat" |
|||
|
|||
// a less primitive HTTP echo server that sends back not only the reqest but |
|||
// also server and client address and port. Might have portability issues with |
|||
// echo |
|||
./socat -T 1 -d -d tcp-l:10081,reuseaddr,fork,crlf system:"echo -e \"\\\"HTTP/1.0 200 OK\\\nDocumentType: text/html\\\n\\\n<html>date: \$\(date\)<br>server:\$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT<br>client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\\\n<pre>\\\"\"; cat; echo -e \"\\\"\\\n</pre></html>\\\"\"" |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// for communicating with an attached modem, I had reasonable results with |
|||
// following command line. Required privileges depend on device mode. |
|||
// after leaving socat, type "sane". |
|||
// replace /dev/ttyS0 by the correct serial line or with /dev/modem |
|||
$ socat readline /dev/ttyS0,raw,echo=0,crlf |
|||
// or |
|||
$ socat readline /dev/ttyS0,raw,echo=0,crlf,nonblock |
|||
// then enter "at$" |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// relay TCP port 80 from everywhere (internet, intranet, dmz) through your |
|||
// firewall to your DMZ webserver (like plug-gw) |
|||
// listen on port 80; whenever a connection is made, fork a new process (parent |
|||
// process keeps accepting connections), su to nobody, and connect to |
|||
// www.dmz.mydomain.org on port 80. |
|||
// attention: this is a substitute for a reverse proxy without providing |
|||
// application level security. |
|||
# socat TCP-LISTEN:80,reuseaddr,fork,su=nobody TCP:www.dmz.mydomain.org:80 |
|||
// Note: parent process keeps running as root, su after forking |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// relay mail from your DMZ server through your firewall. |
|||
// accept connections only on dmz interface and allow connections only from |
|||
// smtp.dmz.mydomain.org. |
|||
// the advantages over plug-gw and other relays are: |
|||
// * you can bind to an IP address (even an alias), therefore enhance security |
|||
// * in your OS you can create several IP aliases and bind another socat daemon |
|||
// to each, making several application servers addressable |
|||
// * lots of options, like switching user, chroot, IP performance tuning |
|||
// * no need for inetd |
|||
# socat -lm -d -d TCP-LISTEN:25,bind=fw.dmz.mydomain.org,fork,su=nobody,range=smtp.dmz.mydomain.org/32 TCP:smtp.intra.mydomain.org:25 |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// convert line terminator in ascii streams, stdin to stdout |
|||
// use unidirectional mode, convert nl to crnl |
|||
$ socat -u - -,crlf |
|||
// or cr to nl |
|||
$ socat -u -,cr - |
|||
|
|||
// save piped data similar to 'tee': |
|||
// copies stdin to stdout, but writes everything to the file too |
|||
$ socat -,echo=0 open:/tmp/myfile,create,trunc,ignoreeof!!/tmp/myfile |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// intrusion testing |
|||
|
|||
// found an XWindow Server behind IP filters with FTP data hole? (you are |
|||
// lucky!) |
|||
// prepare your host: |
|||
# rm -f /tmp/.X11-unix/X1 |
|||
// relay a pseudo display :1 on your machine to victim:0 |
|||
# socat UNIX-LISTEN:/tmp/.X11-unix/X1,fork TCP:host.victim.org:6000,sp=20 & |
|||
// and try to take a screendump (must be very lucky - when server has not even |
|||
// host based authentication!) |
|||
# xwd -root -display :1 -silent >victim.xwd |
|||
|
|||
// you sit behind a socks firewall that has IP filters but lazily allows socks |
|||
// connections to loopback and has only host based X11 security. |
|||
// like above, but from your inside client: |
|||
# socat UNIX-LISTEN:/tmp/.X11-unix/X1,fork SOCKS4:firewall:loopback:6000 |
|||
// or for the HTTP proxy: |
|||
# socat UNIX-LISTEN:/tmp/.X11-unix/X1,fork PROXY:firewall:loopback:6000 |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// forms of stdin with stdout, all equivalent |
|||
$ socat echo - |
|||
$ socat echo STDIO |
|||
$ socat echo STDIN!!STDOUT |
|||
$ socat echo STDIO!!STDIO |
|||
$ socat echo -!!- |
|||
$ socat echo FD:0!!FD:1 |
|||
$ socat echo 0!!1 |
|||
$ socat echo /dev/stdin!!/dev/stdout // if your OS provides these |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// some echo address examples |
|||
$ socat - PIPE |
|||
$ socat - PIPE:/tmp/pipi // other version of echo |
|||
$ socat - PIPE:/tmp/pipi,nonblock!!/tmp/pipi // other version of echo |
|||
$ socat - EXEC:/bin/cat // another echo |
|||
$ socat - SYSTEM:/bin/cat // another echo |
|||
$ socat - TCP:loopback:7 // if inetd echo/TCP service activated |
|||
$ socat - UDP:loopback:7 // if inetd echo/UDP service activated |
|||
$ socat - /tmp/hugo,trunc,ignoreeof!!/tmp/hugo // with delay |
|||
$ socat - UDP:loopback:2000,bind=:2000 // self "connection" |
|||
$ socat - TCP:loopback:2000,bind=:2000 // Linux bug? |
|||
# socat - IP:loopback:222 // raw protocol, self "connected" (attention, |
|||
// Linux might drop packets with less than 8 bytes payload) |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// unidirectional data transfer |
|||
$ socat -u - - |
|||
// like "tail -f", but start with showing all file contents |
|||
$ socat -u FILE:/var/log/syslog.debug,ignoreeof - |
|||
// like "tail -f", but do not show existing file contents |
|||
$ socat -u FILE:/var/log/syslog.debug,ignoreeof,seek-end - |
|||
// write to new file, create with given permission and group (must be member) - race condition with group!!! |
|||
$ socat -u - CREATE:/tmp/outfile1,group=floppy,perm=0640 |
|||
// |
|||
// for an existing file /tmp/outfile1 |
|||
# socat -u - FILE:/tmp/outfile1,group=floppy,perm=0700,user=4321 |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// file handling |
|||
$ socat - FILE:/tmp/outfile1,ignoreeof!!FILE:/tmp/outfile1,append // prints outfile1, then echoes input and protocols into file (appends to old data) |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// unix socket handling |
|||
|
|||
// create a listening unix socket |
|||
$ rm -f /tmp/mysocket; socat UNIX-LISTEN:/tmp/mysocket - |
|||
// from another terminal, connect to this socket |
|||
$ socat UNIX:/tmp/mysocket - |
|||
// then transfer data bidirectionally |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// transport examples |
|||
|
|||
// socks relay (externally socksify applications); |
|||
// your ssh client and OS are not socksified, but you want to pass a socks |
|||
// server with ssh: |
|||
$ socat TCP-LISTEN:10022,fork SOCKS4:socks.mydomain.org:ssh-serv:22 |
|||
$ ssh -p 10022 loopback |
|||
// or better define a ProxyCommand in ~/.ssh/config: |
|||
ProxyCommand socat - SOCKS:socks.mydomain.org:%h:%p |
|||
// and with proxy: |
|||
ProxyCommand socat - PROXY:proxy.mydomain.org:%h:%p,proxyport=8000 |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// application examples |
|||
|
|||
// run sendmail daemon with your favorite network options |
|||
# socat TCP-LISTEN:25,fork,ip-ttl=4,ip-tos=7,tcp-maxseg=576 EXEC:"/usr/sbin/sendmail -bs",nofork |
|||
|
|||
// local mail delivery over UNIX socket - no SUID program required |
|||
# socat UNIX-LISTEN:/tmp/postoffice,fork,perm-early=0666 EXEC:"/usr/sbin/sendmail -bs" |
|||
$ socat - /tmp/postoffice |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// uses of filan |
|||
// see what your operating system opens for you |
|||
$ filan |
|||
// or if that was too detailled |
|||
$ filan -s |
|||
// see what file descriptors are passed via exec function |
|||
$ socat - EXEC:filan,nofork |
|||
$ socat - EXEC:filan |
|||
$ socat - EXEC:filan,pipes,stderr |
|||
$ socat - EXEC:filan,pipes |
|||
$ socat - EXEC:filan,pty |
|||
// see what's done by your shell and with option "pipes" |
|||
$ socat - SYSTEM:filan,pipes |
|||
// see if gdb gives you an equivalent environment or opens some files for your program |
|||
$ gdb ./filan |
|||
(gdb) r |
|||
(gdb) r -s |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// want to use chat from the ppp package? |
|||
// note: some OS's do not need "-e" for echo to print control characters |
|||
// note: chat might send bytes one by one |
|||
// with AIX, a similar program is available under the name "pppdial" |
|||
$ socat -d -d tcp:localhost:25,crlf,nodelay exec:'/usr/sbin/chat -v -s "\"220 \"" "\"HELO loopback\"" "\"250 \"" "\"MAIL FROM: <hugo@localhost>\"" "\"250 \"" "\"RCPT TO: root\"" "\"250 \"" "\"DATA\"" "\"354 \"" "\"test1'$(echo -e "\r.")'\"" "\"250 \"" "\"QUIT\"" "\"221 \""',pty,echo=0,cr |
|||
|
|||
////////////////////////////////////////////////////////////////////////////// |
|||
// IP6 |
|||
|
|||
# socat readline TCP6:[::1]:21 # if your inetd/ftp is listening on ip6 |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// application server solutions |
|||
// run a program (here: /bin/sh) chrooted, unprivileged; |
|||
// parent process stays in real / running as root |
|||
# socat -d -d - EXEC:/bin/sh,chroot=/home/sandbox,su=sandbox,pty |
|||
|
|||
// make a program available on the network chrooted, unprivileged; |
|||
// parent process stays in / running as root |
|||
// script path is already chrooted |
|||
# ./socat -lm -d -d TCP-LISTEN:5555,fork EXEC:/bin/myscript,chroot=/home/sandbox,su=sandbox,pty,stderr |
|||
// to avoid terminal problems, you might - instead of telnet - connect using |
|||
$ socat -,icanon=0,echo=0 tcp:target:5555; reset |
|||
|
|||
|
|||
// access local display from ssh server, when ssh port forwarding is disabled |
|||
// socat must be installed on ssh server host |
|||
// might have to use xauth... |
|||
// this example is one-shot because ssh can handle only one channel |
|||
xterm1$ socat -d -d exec:"ssh www.dest-unreach.org rm -f /tmp/.X11-unix/X9; ~/bin/socat -d -d unix-l\:/tmp/.X11-unix/X9\,fork -" unix:/tmp/.X11-unix/X0 |
|||
xterm2$ ssh target |
|||
target$ DISPLAY=:9 myxapplication |
|||
|
|||
// touch with perms: |
|||
// no race condition for perms (applied with creat() call) |
|||
$ socat -u /dev/null creat:/tmp/tempfile,perm=0600 |
|||
|
|||
// touch with owner and perms: |
|||
// race condition before changing owner, but who cares - only root may access |
|||
# socat -u /dev/null creat:/tmp/tempfile,user=user1,perm=0600 |
|||
|
|||
// invoke an interactive ssh with exec |
|||
// first example passes control chars (^C etc.) to remote server as usual |
|||
socat -,echo=0,raw exec:'ssh server',pty,setsid,ctty |
|||
// second example interprets control chars on local command line |
|||
socat -,echo=0,icanon=0 exec:'ssh server',pty,setsid,ctty |
|||
// afterwards, type "reset"! |
|||
|
|||
// convince ssh to provide an "interactive" shell to your script |
|||
// three main versions for entering password: |
|||
// 1) from your TTY; have 10 seconds to enter password: |
|||
(sleep 10; echo "ls"; sleep 1) |socat - exec:'ssh server',pty |
|||
// 2) from XWindows (DISPLAY !); again 10 seconds |
|||
(sleep 10; echo "ls"; sleep 1) |socat - exec:'ssh server',pty,setsid |
|||
// 3) from script |
|||
(sleep 5; echo PASSWORD; echo ls; sleep 1) |./socat - exec:'ssh server',pty,setsid,ctty |
|||
|
|||
|
|||
// download with proxy CONNECT |
|||
// use echo -e if required for \n |
|||
$ (echo -e "CONNECT 128.129.130.131:80 HTTP/1.0\n"; sleep 5; echo -e "GET |
|||
/download/file HTTP/1.0\n"; sleep 10) |socat -d -d -t 3600 - tcp:proxy:8080,crlf |
|||
|
|||
// retrieve a file from an sshd site with sourceforge style entry menu; |
|||
// fill in your personal values; cat lets you enter your password (will be |
|||
// visible on screen) |
|||
$ (sleep 10; read pass; echo $pass; sleep 10; echo M; sleep 5; echo cat FILENAME; sleep 10) |./socat -d -d -ly - EXEC:'ssh -c 3des -l USER cf.sourceforge.net',pty,setsid,ctty |tee FILENAME |
|||
|
|||
// multicast community on local network: start the following command on all |
|||
// participating hosts; like a conference call: |
|||
# socat -d -d -d -d - udp-datagram:224.0.0.2:6666,bind=:6666,ip-add-membership=224.0.0.2:eth0,bindtodevice=eth0 |
|||
// or |
|||
$ socat -d -d -d -d - udp-datagram:224.0.0.2:6666,bind=:6666,ip-add-membership=224.0.0.2:eth0 |
|||
// possible reasons for failure: |
|||
// iptables or other filters (open your filters as required) |
|||
// packets leave via wrong interface (set route: ...) |
|||
// socket bound to specific address |
|||
|
|||
//============================================================================= |
|||
// GENERIC FUNCTION CALLS |
|||
|
|||
// ioctl(): open CD drive (given value valid on Linux) |
|||
// on my Linux system I find in /usr/include/linux/cdrom.h the define: |
|||
// #define CDROMEJECT 0x5309 /* Ejects the cdrom media */ |
|||
// the following command makes something like ioctl(fd, CDROMEJECT, NULL) |
|||
// (don't care about the read error): |
|||
$ socat /dev/cdrom,o-nonblock,ioctl-void=0x5309 - |
|||
|
|||
// setsockopt(): SO_REUSEADDR |
|||
// the following command performs - beyond lots of overhead - something like: |
|||
// myint=1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &myint, sizeof(myint)) |
|||
$ socat -u udp-recv:7777,setsockopt-int=1:2:1 - |
|||
// setsockopt(): SO_BINDTODEVICE |
|||
|
|||
// ways to apply SO_BINDTODEVICE without using the special socat address option |
|||
// so-bindtodevice: |
|||
// with string argument: |
|||
$ sudo ./socat tcp-l:7777,setsockopt-string=1:25:eth0 pipe |
|||
// with binary argument: |
|||
$ sudo ./socat tcp-l:7777,setsockopt-bin=1:25:x6574683000 pipe |
|||
|
|||
=============================================================================== |
|||
|
|||
// not tested, just ideas, or have problems |
|||
|
|||
|
|||
// traverse firewall for making internal telnet server accessible for outside |
|||
// telnet client, when only outbound traffic (syn-filter) is allowed: |
|||
// on external client run "double server". this process waits for a |
|||
// connection from localhost on port 10023, and, when it is established, waits |
|||
// for a connection from anywhere to port 20023: |
|||
ext$ socat -d TCP-LISTEN:10023,range=localhost TCP-LISTEN:20023 |
|||
// on internal server run double client: |
|||
int$ socat -d TCP:localhost:23 TCP:extclient:10023 |
|||
// or, with socks firewall: |
|||
int$ socat -d TCP:localhost:23 SOCKS:socksserver:extclient:10023 |
|||
// login with: |
|||
ext$ telnet localhost 20023 |
|||
|
|||
// you can make a double server capable of handling multiple instances: |
|||
ext$ socat -d TCP-LISTEN:10023,range=localhost,fork TCP-LISTEN:20023,reuseaddr |
|||
|
|||
// access remote display via ssh, when ssh port forwarding is disabled |
|||
$ socat -d -d EXEC:"ssh target socat - UNIX:/tmp/.X11-unix/X0" TCP-LISTEN:6030 |
|||
$ xclock -display localhost:30 |
|||
|
|||
// relay multiple webserver addresses through your firewall into your DMZ: |
|||
// make IP aliases on your firewall, and then: |
|||
# socat -d -d TCP-L:80,bind=fw-addr1,fork TCP:dmz-www1:80 |
|||
# socat -d -d TCP-L:80,bind=fw-addr2,fork TCP:dmz-www2:80 |
|||
// and for improved security: |
|||
# socat -d -d TCP-L:80,bind=fw-addr3,su=nobody,fork TCP:dmz-www3:80 |
|||
|
|||
// proxy an arbitrary IP protocol over your firewall (answers won't work) |
|||
# socat -d -d IP:0.0.0.0:150,bind=fwnonsec IP:sec-host:150,bind=fwsec |
|||
|
|||
// proxy an unsupported IP protocol over your firewall, point to point |
|||
// end points see firewall interfaces as IP peers! |
|||
# socat -d -d IP:nonsec-host:150,bind=fwnonsec IP:sec-host:150,bind=fwsec |
|||
// note that, for IPsec, you might face problems that are known with NAT |
|||
@ -0,0 +1,96 @@ |
|||
|
|||
Q: What is the clue of socat? |
|||
|
|||
A: socat probably doesn't have any clue. It is more an attempt to smoothly |
|||
integrate similar I/O features that are usually handled differently under |
|||
UNIX. |
|||
|
|||
|
|||
Q: What does the prefix XIO mean? |
|||
|
|||
A: XIO means "extended input/output". It is a library/API that provides a |
|||
common way for handling files, sockets and other forms of I/O. Its advantage is |
|||
that the application may reduce its I/O to open / read+write / close calls, |
|||
while the user controls all I/O details (and even basic process properties) by |
|||
packing options into the filename string. This is the basic part of socat. |
|||
|
|||
|
|||
Q: Is there a Windows port of socat available? |
|||
|
|||
A: Try with Cygwin from http://www.cygwin.com/, or upgrade to Linux. |
|||
|
|||
|
|||
Q: I succeeded to configure and make socat, but ./test.sh says something |
|||
like: |
|||
./test.sh: No such file or directory |
|||
|
|||
A: You need a bash shell in your executable path (locations in $PATH) |
|||
|
|||
|
|||
Q: configure disables readline / openssl / libwrap support because it does not |
|||
find an include file / the library. How can I tell configure where these files |
|||
are? |
|||
|
|||
A: For include locations, use the environment variable CPPFLAGS, for library |
|||
locations use LIBS, e.g.: |
|||
export CPPFLAGS="-I/home/user/ssl/include" |
|||
export LIBS="-L/home/user/ssl/lib" |
|||
On some systems (SunOS), you might also need to set LD_LIBRARY_PATH: |
|||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/user/ssl/lib" |
|||
Then try again: |
|||
make distclean; ./configure; make |
|||
|
|||
|
|||
Q: I succeeded to make socat, but the test.sh script fails for many tests. |
|||
Is my socat build corrupt? |
|||
|
|||
A: Probably your socat program is ok; the tests have been developed on Linux |
|||
2.4, and there they usually succeed. |
|||
But the following OS differences result in errors on non Linux systems: |
|||
* Linux allows to bind a socket to any address of range 127.0.0.0/8, not |
|||
only 127.0.0.1. Some tests are built on this feature, but they might fail on |
|||
other systems. |
|||
* Your OS might have no IP6 implementation |
|||
* MacOS X has some difficulties, e.g. distinguishing sockets and pipes. |
|||
* the OpenSSL tests require OpenSSL support by socat, must have openssl in |
|||
$PATH, and "openssl s_server ..." needs enough entropy to generate a key. |
|||
|
|||
|
|||
Q: When I specify a dual address (two partial addresses linked with "!!") on |
|||
the command line, I get some message "event not found", and my shell history |
|||
has the line truncated. Not even protecting the '!'s with '\' helps. |
|||
|
|||
A: '!' is appearently used by your shell as history expansion character. Say |
|||
"set +H" and add this line to your (bash) profile. |
|||
|
|||
|
|||
Q: On Solaris, socat was built successfully, but when started, it gets killed |
|||
with something like "ld.so.1: ./socat: fatal: libreadline.so.4: open failed: no |
|||
such file or directory" |
|||
|
|||
A: The configure script finds your libreadline, but the runtime loader |
|||
doesn't. Add the directory where the library resides to your LD_LIBRARY_PATH |
|||
variable, e.g.: |
|||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/lib/ |
|||
make distclean; ./configure; make |
|||
|
|||
|
|||
Q: On Solaris, socat was built successfully, but when started, an assertion |
|||
fails: "xioinitialize.c:25: failed assertion `3 << opt_crdly.arg3 == CRDLY' |
|||
|
|||
A: Probably, in a second attempt you set the correct LD_LIBARY_PATH for socat, |
|||
but it had not been set during the ./configure run, or you did not "make clean" |
|||
before running configure. Try it again: |
|||
make distclean; ./configure; make |
|||
|
|||
|
|||
Q: A socat process, run in background from an interactive shell, is always |
|||
stopped with all its child processes after about 5 minutes. killall -9 socat is |
|||
required to clean the system and allow socat to be started again. |
|||
|
|||
A: The terminal (window) might have the TOSTOP flag set and one of the socat |
|||
processes wants to write to the terminal. Clear this flag in your shell: |
|||
stty -tostop |
|||
and start socat again. |
|||
Thanks to Philippe Teuwen for reporting this situation. |
|||
|
|||
@ -0,0 +1,82 @@ |
|||
|
|||
The socat distribution contains the following files: |
|||
|
|||
* README: an introduction to socat |
|||
|
|||
* FILES: a navigator through the socat distribution (this file) |
|||
|
|||
* EXAMPLES: a collection of simple examples how to use socat. |
|||
|
|||
* COPYING: what you and others are allowed to do with socat. |
|||
|
|||
* PORTING: instructions and tips if you want to try socat on a new platform. |
|||
|
|||
* BUGREPORTS: instructions what to do with problems and contributions. |
|||
|
|||
* SECURITY: tips if you want to use socat in a security relevant environment. |
|||
|
|||
* DEVELOPMENT: infos for programmers |
|||
|
|||
* VERSION: the version of the socat distribution, for inclusion during |
|||
compilation |
|||
|
|||
* CHANGES: what happened since first public release |
|||
|
|||
* socat.1: man page of socat |
|||
* socat.html: html version of man page |
|||
* xio.help: reference manual of the address definitions (xioopen function) |
|||
|
|||
* daemon.sh: example shell script for running socat as TCP relay daemon |
|||
* ftp.sh: example shell based ftp client, using socat for transport |
|||
* mail.sh: example shell based smtp client, for execution by socat |
|||
|
|||
* gatherinfo.sh: shell script for gathering info about platform and socat |
|||
implementation |
|||
|
|||
* server.pem: a self signed test cerificate, for self test only |
|||
|
|||
|
|||
The source code system: |
|||
|
|||
* configure: the autoconf generated configurator script |
|||
|
|||
* Makefile.in: the Makefile source input to configure |
|||
|
|||
* config.h.in: the config.h source input to configure |
|||
|
|||
* Config/config.<platform>.h: sample config.h for platform. |
|||
* Config/Makefile.<platform>: sample Makefile for platform. |
|||
Copy the appropriate files to ./config.h and ./Makefile if configure fails |
|||
|
|||
* socat.c: the main C source, including option parsing, general control, and |
|||
the data shuffler |
|||
|
|||
* xio-*.c, xio-*.h: the source of the different address type implementations |
|||
with all their modes and options |
|||
|
|||
* xio*.c, xio*.h: the source of the xio API and xio utilities |
|||
|
|||
* filan.c, filan.h: file descriptor analyzer function |
|||
|
|||
* dalan.c, dalan.h: data language, a most primitive subset of what should |
|||
become a language for describing/generating all kinds of binary data. |
|||
|
|||
* error.c, error.h: the logging subsystem |
|||
|
|||
* sycls.c, sycls.h: explicit system call and C library trace functions |
|||
* sslcls.c, sslcls.h: explicit openssl call trace functions |
|||
|
|||
* xioconfig.h: ensures some dependencies between configure WITH defines; to be |
|||
included immediately after config.h |
|||
|
|||
* sysutils.c, sysutils.h: some more general system (socket, IP) related |
|||
functions, e.g. converting socket addresses to human readable form |
|||
|
|||
* utils.c, utils.h: useful additions to C library; currently memdup, binary |
|||
search, and setenv. |
|||
|
|||
* mytypes.h: some types and macros I miss in C89 |
|||
|
|||
* test.sh: an incomplete attempt to automate tests of socat |
|||
|
|||
* compat.h: ensure some features that might be missing on some platforms |
|||
@ -0,0 +1,201 @@ |
|||
# source: Makefile.in
|
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES)
|
|||
# Published under the GNU General Public License V.2, see file COPYING
|
|||
|
|||
# note: @...@ forms are filled in by configure script
|
|||
|
|||
SHELL = /bin/sh |
|||
AR = @AR@ |
|||
RANLIB = @RANLIB@ |
|||
|
|||
.SUFFIXES: .c .o |
|||
|
|||
prefix = @prefix@ |
|||
exec_prefix = @exec_prefix@ |
|||
|
|||
BINDEST = @bindir@ |
|||
|
|||
datarootdir = @datarootdir@ |
|||
MANDEST = @mandir@ |
|||
|
|||
srcdir = @srcdir@ |
|||
VPATH = @srcdir@ |
|||
|
|||
CC = @CC@ |
|||
CCOPTS = $(CCOPT) |
|||
|
|||
SYSDEFS = @SYSDEFS@ |
|||
CPPFLAGS = -I. @CPPFLAGS@ |
|||
#0 INCLS = -I. @V_INCL@
|
|||
DEFS = @DEFS@ |
|||
LIBS = @LIBS@ |
|||
LDFLAGS = @LDFLAGS@ |
|||
|
|||
INSTALL = @INSTALL@ |
|||
|
|||
#OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) @LIBOBJS@
|
|||
|
|||
|
|||
#0 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(INCLS)
|
|||
CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(CPPFLAGS) |
|||
CLIBS = $(LIBS) |
|||
#CLIBS = $(LIBS) -lm -lefence
|
|||
XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
|
|||
xiosignal.c xiosigchld.c xioread.c xiowrite.c \
|
|||
xiolayer.c xioshutdown.c xioclose.c xioexit.c \
|
|||
xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
|
|||
xio-gopen.c xio-creat.c xio-file.c xio-named.c \
|
|||
xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
|
|||
xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
|
|||
xio-sctp.c xio-rawip.c \
|
|||
xio-socks.c xio-proxy.c xio-udp.c \
|
|||
xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
|
|||
xio-pty.c xio-openssl.c xio-streams.c\
|
|||
xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c |
|||
XIOOBJS = $(XIOSRCS:.c=.o) |
|||
UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c vsnprintf_r.c snprinterr.c @FILAN@ sycls.c @SSLCLS@ |
|||
UTLOBJS = $(UTLSRCS:.c=.o) |
|||
CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c |
|||
OFILES = $(CFILES:.c=.o) |
|||
PROGS = socat procan filan |
|||
|
|||
HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h vsnprintf_r.h snprinterr.h compat.h \
|
|||
xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
|
|||
xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
|
|||
xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
|
|||
xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
|
|||
xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
|
|||
xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
|
|||
xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
|
|||
xio-system.h xio-termios.h xio-readline.h \
|
|||
xio-pty.h xio-openssl.h xio-streams.h \
|
|||
xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h |
|||
|
|||
|
|||
DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html |
|||
SHFILES = daemon.sh mail.sh ftp.sh readline.sh \
|
|||
socat_buildscript_for_android.sh |
|||
TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
|
|||
proxy.sh socks4a-echo.sh |
|||
OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
|
|||
Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
|
|||
Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
|
|||
Config/Makefile.NetBSD-5-1 Config/config.NetBSD-5-1.h \
|
|||
Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h \
|
|||
Config/Makefile.AIX-5-3 Config/config.AIX-5-3.h \
|
|||
Config/Makefile.Cygwin-1-5-25 Config/config.Cygwin-1-5-25.h \
|
|||
Config/Makefile.MacOSX-10-5 Config/config.MacOSX-10-5.h \
|
|||
Config/Makefile.DragonFly-2-8-2 Config/config.DragonFly-2-8-2.h |
|||
|
|||
all: progs doc |
|||
|
|||
scmclean: gitclean |
|||
|
|||
gitclean: distclean docclean |
|||
rm -f Makefile.bak configure |
|||
|
|||
doc: doc/socat.1 doc/socat.html |
|||
|
|||
docclean: |
|||
rm -f doc/socat.1 doc/socat.html |
|||
|
|||
doc/socat.1: doc/socat.yo |
|||
yodl2man -o $@ $+ |
|||
|
|||
doc/socat.html: doc/socat.yo |
|||
cd doc; yodl2html -o socat.html socat.yo; cd .. |
|||
|
|||
progs: $(PROGS) |
|||
|
|||
depend: $(CFILES) $(HFILES) |
|||
makedepend $(SYSDEFS) $(CFILES) |
|||
|
|||
socat: socat.o libxio.a |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS) |
|||
|
|||
PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o |
|||
procan: $(PROCAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS) |
|||
|
|||
FILAN_OBJS=filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o |
|||
filan: $(FILAN_OBJS) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FILAN_OBJS) $(CLIBS) |
|||
|
|||
libxio.a: $(XIOOBJS) $(UTLOBJS) |
|||
$(AR) r $@ $(XIOOBJS) $(UTLOBJS) |
|||
$(RANLIB) $@ |
|||
|
|||
doc: doc/xio.help |
|||
#
|
|||
|
|||
strip: progs |
|||
strip $(PROGS) |
|||
|
|||
install: progs $(srcdir)/doc/socat.1 |
|||
mkdir -p $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) |
|||
$(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) |
|||
mkdir -p $(DESTDIR)$(MANDEST)/man1 |
|||
$(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ |
|||
|
|||
uninstall: |
|||
rm -f $(DESTDIR)$(BINDEST)/socat |
|||
rm -f $(DESTDIR)$(BINDEST)/procan |
|||
rm -f $(DESTDIR)$(BINDEST)/filan |
|||
rm -f $(DESTDIR)$(MANDEST)/man1/socat.1 |
|||
|
|||
# make a GNU-zipped tar ball of the source files
|
|||
dist: socat.tar.gz socat.tar.bz2 |
|||
|
|||
socat.tar.gz: socat.tar |
|||
gzip -9 <socat.tar >socat.tar.gz |
|||
|
|||
socat.tar.bz2: socat.tar |
|||
bzip2 -9 <socat.tar >socat.tar.bz2 |
|||
|
|||
VERSION = `sed 's/"//g' VERSION` |
|||
TARDIR = socat-$(VERSION) |
|||
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec \ |
|||
configure.ac |
|||
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi |
|||
tar cf - $+ |(cd $(TARDIR); tar xf -) |
|||
tar cvf socat.tar $(TARDIR) |
|||
rm -f $(TARDIR)/COPYING # write protected |
|||
rm -r $(TARDIR) |
|||
|
|||
clean: |
|||
rm -f *.o libxio.a socat procan filan \
|
|||
socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
|
|||
socat.out compile.log test.log |
|||
|
|||
# remove all files that are generated from the original socat distribution
|
|||
# note that Makefile is also removed, so you have to start with ./configure
|
|||
# again
|
|||
distclean: clean |
|||
rm -f config.status config.cache config.log config.h Makefile |
|||
rm -rf autom4te.cache |
|||
|
|||
info: socat |
|||
uname -a >socat.out |
|||
./socat -V >>socat.out |
|||
./socat -hh >>socat.out |
|||
|
|||
# perform some tests on socat
|
|||
test: progs |
|||
./test.sh |
|||
|
|||
cert: |
|||
# prepare critical files with correct permissions to avoid race cond |
|||
>cert.key |
|||
>cert.pem |
|||
chmod 600 cert.key cert.pem |
|||
# generate a private key |
|||
openssl genrsa -out cert.key 1024 |
|||
# generate a self signed cert |
|||
openssl req -new -key cert.key -x509 -days 3653 -out cert.crt |
|||
# ...enter fields |
|||
# generate the pem file |
|||
cat cert.key cert.crt >cert.pem |
|||
#echo use cert.pem on requestors side, i.e. with option cert=cert.pem |
|||
#echo use cert.crt on checkers side, i.e. with option cafile=cert.crt |
|||
@ -0,0 +1,72 @@ |
|||
|
|||
DEVELOPMENT PLATFORMS |
|||
|
|||
Primary development platform for socat is currently SuSE Linux 8.2 with |
|||
a 2.4.20 kernel. New features are then ported to the non-Linux platforms on the |
|||
Sourceforge compile farm (per July 2003: SunOS 5.8 with gcc, and MacOS X 10.2), |
|||
and AIX 5.1 with gcc. But due to limited time resources and restricted |
|||
(non-root) access to these systems I cannot extensively test socat there. |
|||
|
|||
|
|||
PORTING STEPS |
|||
|
|||
If you want to port socat to another operating system you will typically go |
|||
through two phases: First, you might just try to compile and run the actual |
|||
socat distribution (passive phase). Then, you should see if your platform |
|||
has some nice features that are not yet used in socat, and add code for |
|||
supporting them (active phase). At last, I encourage you to send me your |
|||
changes so I can integrate them into the main socat distribution. |
|||
|
|||
|
|||
PASSIVE PHASE: |
|||
|
|||
* Generate Makefile and config.h: |
|||
. If you have gcc, then just invoke "./configure". |
|||
. If you use another C compiler, configure might not work properly; |
|||
You will have to adapt config.h and Makefile manually. |
|||
Change compiler options or defines to use all features of the operating |
|||
system (not only ANSI-C; e.g. HP-UX: -Ae!) |
|||
Some practical config.<platform>.h examples have been included in the |
|||
Config directory of the source that might serve as starting point. |
|||
|
|||
* Try to "make" socat; correct the errors. If some constants are undefined, |
|||
please disable these parts option-dependent, not platform-dependent (use |
|||
#ifdef TCP_OPTION instead of #if MY_OS) |
|||
|
|||
* If you have big troubles compiling socat then try configure with options |
|||
--disable-filan --disable-sycls; this excludes some of the most system |
|||
dependent parts. |
|||
|
|||
* After successful compilation and linking, run "make test" and try some |
|||
examples. |
|||
|
|||
|
|||
ACTIVE PHASE: |
|||
|
|||
* Check the man pages of your operating system for open(2), fcntl(2), |
|||
setsockopt(2), ioctl(2), socket(7), ip(7), tcp(7), termios etc. and the |
|||
include files where you find the definitions of existing options, for new |
|||
options and implement them - again option-dependent. |
|||
Places to add code for the new options: |
|||
. xioopts.h: enum e_optcode (sorted numerically/alphabetically by name) |
|||
. xio-*.c: select the appropriate address file (e.g., xio-tcp.c for |
|||
TCP-options) and make a record of type struct optdesc: opt_newoption |
|||
. xio-*.h: the declation of struct optdesc |
|||
. xioopts.c: add records to struct optname optionnames for all appropriate |
|||
names (sorted strictly ASCII for binary search) |
|||
. filan.c: add the option to the appropriate array (sockopts, ipopts, |
|||
tcpopts) |
|||
. socat.html, socat.1, xio.help: write a short documentation and tell which |
|||
platform and version implements this option |
|||
|
|||
* problems may occur especially: |
|||
. with 16 or 64 bit systems |
|||
. if snprintf() etc. is missing |
|||
. on UNIX emulations, e.g. Cygwin |
|||
|
|||
|
|||
INTEGRATION |
|||
|
|||
* If you ported socat to another platform: |
|||
To let other people participate please send the modified files or a patch |
|||
file and the files generated by ./gatherinfo.sh to socat@dest-unreach.org. |
|||
@ -0,0 +1,303 @@ |
|||
|
|||
about |
|||
----- |
|||
|
|||
socat is a relay for bidirectional data transfer between two independent data |
|||
channels. Each of these data channels may be a file, pipe, device (serial line |
|||
etc. or a pseudo terminal), a socket (UNIX, IP4, IP6 - raw, UDP, TCP), an |
|||
SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU |
|||
line editor (readline), a program, or a combination of two of these. |
|||
These modes include generation of "listening" sockets, named pipes, and pseudo |
|||
terminals. |
|||
|
|||
socat can be used, e.g., as TCP port forwarder (one-shot or daemon), as an |
|||
external socksifier, for attacking weak firewalls, as a shell interface to UNIX |
|||
sockets, IP6 relay, for redirecting TCP oriented programs to a serial line, to |
|||
logically connect serial lines on different computers, or to establish a |
|||
relatively secure environment (su and chroot) for running client or server |
|||
shell scripts with network connections. |
|||
|
|||
Many options are available to refine socats behaviour: |
|||
terminal parameters, open() options, file permissions, file and process owners, |
|||
basic socket options like bind address, advanced socket options like IP source |
|||
routing, linger, TTL, TOS (type of service), or TCP performance tuning. |
|||
|
|||
More capabilities, like daemon mode with forking, client address check, |
|||
"tail -f" mode, some stream data processing (line terminator conversion), |
|||
choosing sockets, pipes, or ptys for interprocess communication, debug and |
|||
trace options, logging to syslog, stderr or file, and last but not least |
|||
precise error messages make it a versatile tool for many different purposes. |
|||
|
|||
In fact, many of these features already exist in specialized tools; but until |
|||
now, there does not seem to exists another tool that provides such a generic, |
|||
flexible, simple and almost comprehensive (UNIX) byte stream connector. |
|||
|
|||
|
|||
packages |
|||
-------- |
|||
|
|||
before bothering with compilers, dependencies and include files, you might |
|||
try to get a binary distribution that matches your platform. Have a look at |
|||
the projects home page for actual information regarding socat binary |
|||
distributions. |
|||
|
|||
|
|||
platforms |
|||
--------- |
|||
|
|||
socat 1.7.0 was compiled and more or less successfully tested under the |
|||
following operating systems: |
|||
|
|||
Debian lenny/sid on x86, kernel 2.6.24 |
|||
FreeBSD 6.1 on x86 |
|||
NetBSD 4.0 on x86 |
|||
OpenBSD 4.3 on x86 |
|||
OpenSolaris 10 on x86 with gcc |
|||
Mac OS X 10.5.5 on iMac G5, with libreadline |
|||
HP-UX 11.23 |
|||
AIX 5.3 on 64bit Power4 with gcc |
|||
Cygwin 1.5.25 on i686 |
|||
|
|||
tests on Tru64 can no longer be performed because HP testdrive has taken down |
|||
these hosts. |
|||
|
|||
Some versions of socat have been reported to successfully compile under older |
|||
Linux versions back to RedHat 2.1 (kernel 1.2.13, gcc 2.7.0), under AIX 4.1 and |
|||
4.3, SunOS 5.7-5.8, FreeBSD 4.2 - 4.9, MacOS X 10.1, Cygwin, Solaris 8 on x86, |
|||
OSR 5.0.6, NetBSD 1.6.1 and 2.0.2, OpenBSD 3.4 and 3.8, Tru64 5.1B, Mac OS X |
|||
10.1-10.2, and HP-UX 11 |
|||
|
|||
It might well compile and run under other UNIX like operating systems. |
|||
|
|||
|
|||
install |
|||
------- |
|||
|
|||
Get the tarball and extract it: |
|||
tar xzf socat.tar.gz |
|||
cd socat-1.7.3.0 |
|||
./configure |
|||
make |
|||
su |
|||
make install # installs socat, filan, and procan in /usr/local/bin |
|||
|
|||
For compiling socat, gcc (or egc) is recommended. |
|||
If gcc is not available, the configure script will fail to determine |
|||
some features; then you'd better begin with one of the Makefiles and config.h's |
|||
from the Config directory. |
|||
|
|||
If you have problems with the OpenSSL library, you can apply the option |
|||
"--disable-openssl" to configure. |
|||
|
|||
If you have problems with the readline library or (n)curses, you can apply the |
|||
option "--disable-readline" to configure. |
|||
|
|||
If you have problems with the tcp wrappers library, you can apply the option |
|||
"--disable-libwrap" to configure. |
|||
|
|||
If you still get errors or a tremendous amount of warnings you can exclude |
|||
the features for system call tracing and file descriptor analyzing by |
|||
applying the options "--disable-sycls --disable-filan" to configure. |
|||
|
|||
You still need the functions vsnprintf and snprintf that are in the GNU libc, |
|||
but might not be available with some proprietary libc's. |
|||
|
|||
The configure script looks for headers and libraries of openssl, readline, and |
|||
tcp wrappers in the OS'es standard places and in the subdirectories include/ |
|||
and lib/ of the following places: |
|||
/sw/ |
|||
/usr/local/ |
|||
/opt/freeware/ |
|||
/usr/sfw/ |
|||
and for openssl also in: |
|||
/usr/local/ssl/ |
|||
In case of unexpected behaviour it is important to understand that configure |
|||
first searches for the appropriate include file and then expects to find the |
|||
library in the associated lib directory. That means, when e.g. a OpenSSL |
|||
installation resides under /usr/local and there is a symbolic link from |
|||
/usr/include/ssl/ssl.h to /usr/local/ssl/include/ssl/ssl.h, configure will find |
|||
the /usr/include/... header and will therefore expect libssl in /usr/lib |
|||
instead of /usr/local/... |
|||
|
|||
If configure does not find a header file or library but you know where it is, |
|||
you can specify additional search locations, e.g.: |
|||
export LIBS="-L$HOME/lib" |
|||
export CPPFLAGS="-I$HOME/include" |
|||
before running configure and make. |
|||
|
|||
For other operating systems, if socat does not compile without errors, refer to |
|||
the file PORTING. |
|||
|
|||
|
|||
platform specifics - redhat |
|||
--------------------------- |
|||
|
|||
Install the following packages before building socat: |
|||
tcp_wrappers-devel |
|||
readline-devel |
|||
openssl-devel |
|||
|
|||
On RedHat Linux 9.0, including openssl/ssl.h might fail due to problems with |
|||
the krb5-devel package. configure reacts with disabling openssl integration. |
|||
To solve this issue, help cpp to find the krb5.h include file: |
|||
CPPFLAGS="-I/usr/kerberos/include" ./configure |
|||
|
|||
|
|||
platform specifics - aix |
|||
------------------------ |
|||
|
|||
The flock() prototype is not available but the function is. Thus, to enable the |
|||
socat flock options, run configure and then change in config.h the line |
|||
/* #undef HAVE_FLOCK */ |
|||
to |
|||
#define HAVE_FLOCK 1 |
|||
and continue the build process. |
|||
|
|||
When using the OpenSSL rpm provided by IBM, configure might need the |
|||
environment variable setting: |
|||
LIBS="-L/opt/freeware/lib" |
|||
|
|||
When using the OpenSSL bundle provided by IBM, egd needs to be installed too |
|||
to get enough entropy. |
|||
|
|||
socat compiles not only with gcc, but also with xlc. Just adapt the Makefile: |
|||
replace gcc by /usr/vac/bin/xlc and remove gcc specific options |
|||
"-Wall -Wno-parentheses". |
|||
|
|||
When linking with the OpenSSL library provided by IBM, errors may occur: |
|||
ld: 0711-317 ERROR: Undefined symbol: .__umoddi3 |
|||
In this case, you need to link with libgcc or compile libcrypt yourself using |
|||
xlc, or disable SSL (in config.h, undefine WITH_OPENSSL and recompile) |
|||
|
|||
The score of test.sh can be improved by uncommenting MISCDELAY=1 in this |
|||
script. |
|||
|
|||
|
|||
platform specifics - solaris |
|||
---------------------------- |
|||
|
|||
If libreadline or libssl are in a directory not searched by the loader per |
|||
default, e.g. /opt/sfw/lib, you must add this directory to $LD_LIBRARY_PATH, |
|||
for running both configure and the socat executables, e.g.: |
|||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/lib |
|||
|
|||
For some shell scripts, it is preferable to have /usr/xpg4/bin at a prominent |
|||
position in $PATH. |
|||
|
|||
With the default compiler define _GNU_SOURCE, the CMSG_* macros are not |
|||
available, and therefore ancillary messages cannot be used. To enable these try |
|||
the following: |
|||
After running ./configure, edit Makefile and replace "-D_GNU_SOURCE" with |
|||
"-D_XPG4_2 -D__EXTENSIONS__" and run make |
|||
|
|||
|
|||
platform specifics - hp-ux |
|||
-------------------------- |
|||
|
|||
Ancillary messages cannot be compiled in with socat: both struct msghdr and |
|||
struct cmsghdr are required. Compiling with -D_XOPEN_SOURCE_EXTENDED provides |
|||
struct msghdr but disables struct cmsghdr while -D_OPEN_SOURCE disables struct |
|||
msghdr but disables struct cmsghdr. Please contact socat development if you |
|||
know a solution. |
|||
|
|||
Shutting down the write channel of a UNIX domain socket does not seem to |
|||
trigger an EOF on the peer socket. This makes problems with the exec and |
|||
system addresses. |
|||
|
|||
This OS provides the type "long long", but not the strtoll() function to read |
|||
data into a long long variable. |
|||
|
|||
UNIX domain sockets are only supported with SOCK_STREAM, not with datagrams |
|||
(see man 7 unix). |
|||
|
|||
With UDP sockets it seems to happen that the select() call reports available |
|||
data (or EOF) but a subsequent read() call hangs. |
|||
|
|||
|
|||
platform specifics - tru64 |
|||
-------------------------- |
|||
|
|||
When the use of the readline address fails with an error like: |
|||
socat: /sbin/loader: Fatal Error: Reference to unresolvable symbol "tgetent" in ".../libreadline.so.4" |
|||
and you still want to use shared libraries, try the following workaround: |
|||
$ make distclean; LIBS="-static" ./configure |
|||
remove the "-static" occurrence in Makefile |
|||
$ make |
|||
|
|||
|
|||
documentation |
|||
------------- |
|||
|
|||
These files reside in the doc subdirectory: |
|||
|
|||
socat.1 is the man page, socat.html is the HTML based man page. It is actual, |
|||
but describes only the more useful options. |
|||
|
|||
xio.help is an older, but more exact description in text form; with socat |
|||
version 1.6.0 it is outdated. |
|||
|
|||
doc/socat-openssltunnel.html is a simple tutorial for a private SSL connection. |
|||
doc/socat-multicast.html is a short tutorial for multicast and broadcast |
|||
communications. |
|||
doc/socat-tun shows how to build a virtual network between two hosts. |
|||
|
|||
socat.1 and socat.html can be generated from socat.yo (which is released with |
|||
socat 1.6.0.1 and later) using the yodl document language package. Maintenance |
|||
of yodl had been discontinued by its author |
|||
(http://www.xs4all.nl/~jantien/yodl/) (there seems to be a revival at |
|||
http://yodl.sourceforge.net/ though). For socat, the old version 1.31 is used; |
|||
an rpm is still distributed with recent OpenSuSE versions (confirmed for |
|||
OpenSuSE 10.1 in suse/i586/yodl-1.31.18-1142.i586.rpm). It appears to install |
|||
smoothly also under RedHat Linux. After yodl 1.31 installation, the following |
|||
correction must be performed in /usr/share/yodl/shared.yo in two places: |
|||
< whenhtml(htmlcommand(<!)ARG1+htmlcommand(>))) |
|||
> whenhtml(htmlcommand(<!--)ARG1+htmlcommand(-->))) |
|||
|
|||
|
|||
license |
|||
------- |
|||
|
|||
socat is distributed under the terms of the GNU GPLv2; |
|||
except for install-sh, which is copyright MIT, with its own license; |
|||
|
|||
In addition, as a special exception, the copyright holder |
|||
gives permission to link the code of this program with |
|||
any version of the OpenSSL library which is distributed |
|||
under a license identical to that listed in the included |
|||
COPYING.OpenSSL file, and distribute linked combinations |
|||
including the two. You must obey the GNU General Public |
|||
License in all respects for all of the code used other |
|||
than OpenSSL. If you modify this file, you may extend this |
|||
exception to your version of the file, but you are not |
|||
obligated to do so. If you do not wish to do so, delete |
|||
this exception statement from your version. |
|||
|
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, version 2 of the License |
|||
|
|||
This program 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 General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|||
|
|||
|
|||
contact |
|||
------- |
|||
|
|||
For questions, bug reports, ideas, contributions etc. please contact |
|||
socat@dest-unreach.org |
|||
|
|||
For socat source distribution, bug fixes, and latest news see |
|||
http://www.dest-unreach.org/socat/ |
|||
|
|||
www.socat.org is an alternate site providing the same contents. |
|||
|
|||
public git repository: |
|||
git://repo.or.cz/socat.git |
|||
http://repo.or.cz/r/socat.git |
|||
@ -0,0 +1,67 @@ |
|||
|
|||
David Acker has patched socat to add OpenSSL FIPS. |
|||
See http://oss-institute.org/fips-faq.html and |
|||
http://linuxdevices.com/news/NS4742716157.html for more information. |
|||
|
|||
The patch that is integrated into socat 1.5 does the following: |
|||
|
|||
Add support for LDFLAGS in Makefile. LDFLAGS can be specified on the |
|||
configure command line and then will be carried over into the make. |
|||
|
|||
Add fips support. Requires OpenSSL 0.9.7j-fips-dev from |
|||
http://www.openssl.org/source/OpenSSL-fips-1.0.tar.gz built with fips |
|||
support turned on. use ./Configure fips [os-arc], for example |
|||
./Configure fips linux-pentium |
|||
|
|||
The LDFLAGS is needed to point a build against a library |
|||
located in a non-standard location. For example, if you download and |
|||
build openssl manually, it gets installed in /usr/local/ssl by default. |
|||
|
|||
The FIPS support patches involve adding an option to enable/disable fips |
|||
in configure (enabled by default), checking the system for FIPS support |
|||
during configure, and then adding a fips option to socats openssl address |
|||
to turn on fips mode. The openssl binary uses an environment variable |
|||
instead of a command line flag. |
|||
FIPS mode requires both a compile time flag of OPENSSL_FIPS and a |
|||
runtime call of FIPS_mode_set(1). Fips mode requires building with the |
|||
fipsld script provided by OpenSSL. FIPS tracks the pid of the process that |
|||
initializes things so after a fork, the child must reinitialize. When the |
|||
ssl code detects a forks occur and if FIPS mode was enabled, it reinitializes |
|||
FIPS by disabling and then enabling it again. |
|||
|
|||
To produce Davids enviroment, do the following: |
|||
To build openssl |
|||
download OpenSSL 0.9.7j-fips-dev from |
|||
http://www.openssl.org/source/OpenSSL-fips-1.0.tar.gz |
|||
tar xzf OpenSSL-fips-1.0.tar.gz |
|||
cd openssl |
|||
./Configure fips linux-pentium |
|||
make |
|||
make test |
|||
(become root) |
|||
make install |
|||
This leaves an install in /usr/local/ssl |
|||
|
|||
To build socat: |
|||
setup directory with socat 1.5 or higher. |
|||
cd socat-1.5.0.0 |
|||
./configure CPPFLAGS=-I/usr/local/ssl/include/ LDFLAGS=-L/usr/local/ssl/lib/ FIPSLD=/usr/local/ssl/bin/fipsld |
|||
make |
|||
(become root) |
|||
make install |
|||
|
|||
To run tests we make sure the new openssl is used: |
|||
|
|||
export PATH=/usr/local/ssl/bin:$PATH |
|||
./test.sh fips |
|||
|
|||
There are two tests in test.sh that depend on fips: |
|||
|
|||
OPENSSL_FIPS_BOTHAUTH performs a SSL client to server connection with |
|||
certificate based authentication in both directions. If it works FIPS mode |
|||
seems to be ok. |
|||
|
|||
OPENSSL_FIPS_SECURITY generates a certificaet/key pair without fips support. It |
|||
then tries a SSL connection in "normal" mode which is expected to work. In the |
|||
second phase it uses fips mode with these credentials which is expected to |
|||
fail. If so, the test succeeded. |
|||
@ -0,0 +1,41 @@ |
|||
|
|||
Tips for using socat in secured environments: |
|||
|
|||
* Configure socat to only enable the required features, e.g. to protect your |
|||
filesystem from any accesses through socat: |
|||
make distclean |
|||
./configure --disable-file --disable-creat --disable-gopen \ |
|||
--disable-pipe --disable-unix --disable-exec --disable-system |
|||
use "socat -V" to see what features are still enabled; see |
|||
./configure --help for more options to disable |
|||
|
|||
* Do NOT install socat SUID root or so when you have untrusted users or |
|||
unprivileged daemons on your machine, because the full install of socat can |
|||
override arbitrary files and execute arbitrary programs! |
|||
|
|||
* Set logging to "-d -d" (in special cases even higher) |
|||
|
|||
* With files, protect against symlink attacks with nofollow (Linux), and |
|||
avoid accessing files in world-writable directories like /tmp |
|||
|
|||
* When listening, use bind option (except UNIX domain sockets) |
|||
|
|||
* When listening, use range option (currently only for IP4 sockets) |
|||
|
|||
* When using socat with system, exec, or in a shell script, know what you do |
|||
|
|||
* With system and exec, use absolute pathes or set the path option |
|||
|
|||
* When starting programs with socat, consider using the chroot option (this |
|||
requires root, so use the substuser option too). |
|||
|
|||
* Start socat as root only if required; if so, use substuser option |
|||
Note: starting a SUID program after applying substuser or setuid gives the |
|||
process the SUID owner, which might give root privileges again. |
|||
|
|||
* Socat, like netcat, is what intruders like to have on their victims machine: |
|||
once they have gained a toehold they try to establish a versatile connection |
|||
back to their attack base, and they want to attack other systems. For both |
|||
purposes, socat could be helpful. Therefore, it might be useful to install |
|||
socat with owner/permissions root:socatgrp/750, and to make all trusted users |
|||
members of group socatgrp. |
|||
@ -0,0 +1 @@ |
|||
"1.7.3.4" |
|||
@ -0,0 +1,707 @@ |
|||
/* source: compat.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __compat_h_included |
|||
#define __compat_h_included 1 |
|||
|
|||
#if !HAVE_DECL_ENVIRON && HAVE_VAR_ENVIRON |
|||
extern char **environ; |
|||
#endif |
|||
|
|||
/*****************************************************************************/ |
|||
/* I dont like this system dependent part, but it would be quite a challenge |
|||
for configure */ |
|||
|
|||
/* define if the following does not work: |
|||
socket() |
|||
connect() -> Connection refused |
|||
connect() -> ok |
|||
instead, it needs close() and socket() between the two connect() attmpts: */ |
|||
#if __FreeBSD__ || __APPLE__ || _AIX || __hpux__ || __osf__ |
|||
# undef SOCKET_CAN_RECOVER |
|||
#else |
|||
# define SOCKET_CAN_RECOVER 1 |
|||
#endif |
|||
|
|||
/* define if stat() says that pipes are sockets */ |
|||
#if __APPLE__ |
|||
# define PIPE_STATES_SOCKET 1 |
|||
#else |
|||
# undef PIPE_STATES_SOCKET |
|||
#endif |
|||
|
|||
/*****************************************************************************/ |
|||
|
|||
/* substitute some features that might be missing on some platforms */ |
|||
|
|||
#if !HAVE_TYPE_SIG_ATOMIC_T |
|||
typedef int sig_atomic_t; |
|||
#endif |
|||
|
|||
#ifndef SHUT_RD |
|||
# define SHUT_RD 0 |
|||
#endif |
|||
#ifndef SHUT_WR |
|||
# define SHUT_WR 1 |
|||
#endif |
|||
#ifndef SHUT_RDWR |
|||
# define SHUT_RDWR 2 |
|||
#endif |
|||
|
|||
#ifndef MIN |
|||
# define MIN(x,y) ((x)<=(y)?(x):(y)) |
|||
#endif |
|||
|
|||
#ifndef MAX |
|||
# define MAX(x,y) ((x)>=(y)?(x):(y)) |
|||
#endif |
|||
|
|||
/* O_ASYNC: Linux 2.2.10 */ |
|||
#if !defined(O_ASYNC) && defined(FASYNC) |
|||
# define O_ASYNC FASYNC |
|||
#endif |
|||
|
|||
/* NGROUPS not defined on Solaris */ |
|||
#if !defined(NGROUPS) && defined(NGROUPS_MAX) |
|||
# define NGROUPS NGROUPS_MAX |
|||
#endif |
|||
|
|||
/* UNIX_PATH_MAX: AIX 4.3.3 */ |
|||
#ifndef UNIX_PATH_MAX |
|||
# define UNIX_PATH_MAX 104 /*! why 104? Linux: 108 ! */ |
|||
#endif |
|||
|
|||
|
|||
/* SOL_IP: AIX 4.3.3 */ |
|||
#ifndef SOL_IP |
|||
# define SOL_IP 0 |
|||
#endif |
|||
|
|||
/* SOL_TCP: AIX 4.3.3 */ |
|||
#ifndef SOL_TCP |
|||
# ifdef IPPROTO_TCP |
|||
# define SOL_TCP IPPROTO_TCP |
|||
# endif |
|||
#endif |
|||
|
|||
/* POSIX.1 doesn't seem to know sockets */ |
|||
#ifndef S_ISSOCK |
|||
# define S_ISSOCK(fmode) 0 |
|||
#endif |
|||
|
|||
#if defined(IPPROTO_IPV6) && !defined(SOL_IPV6) |
|||
# define SOL_IPV6 IPPROTO_IPV6 |
|||
#endif |
|||
|
|||
/* all unsigned */ |
|||
#if !defined(HAVE_BASIC_SIZE_T) || !HAVE_BASIC_SIZE_T |
|||
# undef HAVE_BASIC_SIZE_T |
|||
# define HAVE_BASIC_SIZE_T 6 |
|||
#endif |
|||
#if HAVE_BASIC_SIZE_T==2 |
|||
# define SIZET_MAX USHRT_MAX |
|||
# define SSIZET_MIN SHRT_MIN |
|||
# define SSIZET_MAX SHRT_MAX |
|||
# define F_Zd "%hd" |
|||
# define F_Zu "%hu" |
|||
#elif HAVE_BASIC_SIZE_T==4 |
|||
# define SIZET_MAX UINT_MAX |
|||
# define SSIZET_MIN INT_MIN |
|||
# define SSIZET_MAX INT_MAX |
|||
# define F_Zd "%""d" |
|||
# define F_Zu "%u" |
|||
#elif HAVE_BASIC_SIZE_T==6 |
|||
# define SIZET_MAX ULONG_MAX |
|||
# define SSIZET_MIN LONG_MIN |
|||
# define SSIZET_MAX LONG_MAX |
|||
# define F_Zd "%ld" |
|||
# define F_Zu "%lu" |
|||
#elif HAVE_BASIC_SIZE_T==8 |
|||
# define SIZET_MAX ULLONG_MAX |
|||
# define SSIZET_MIN LLONG_MIN |
|||
# define SSIZET_MAX LLONG_MAX |
|||
# define F_Zd "%Ld" |
|||
# define F_Zu "%Lu" |
|||
#else |
|||
# error "HAVE_BASIC_SIZE_T is out of range:" HAVE_BASIC_SIZE_T |
|||
#endif |
|||
#if HAVE_FORMAT_Z |
|||
# undef F_Zd |
|||
# undef F_Zu |
|||
# define F_Zd "%Zd" |
|||
# define F_Zu "%Zu" |
|||
#endif |
|||
|
|||
|
|||
/* mode_t is always unsigned; default: unsigned int */ |
|||
#if !defined(HAVE_BASIC_MODE_T) || !HAVE_BASIC_MODE_T |
|||
# undef HAVE_BASIC_MODE_T |
|||
# define HAVE_BASIC_MODE_T 4 |
|||
#endif |
|||
#ifndef F_mode |
|||
# if HAVE_BASIC_MODE_T==1 || HAVE_BASIC_MODE_T==2 |
|||
#define F_mode "0%03ho" |
|||
# elif HAVE_BASIC_MODE_T==3 || HAVE_BASIC_MODE_T==4 |
|||
#define F_mode "0%03o" |
|||
# elif HAVE_BASIC_MODE_T==5 || HAVE_BASIC_MODE_T==6 |
|||
#define F_mode "0%03lo" |
|||
# else |
|||
#error "HAVE_BASIC_MODE_T is out of range:" HAVE_BASIC_MODE_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* default: unsigned int */ |
|||
#if !defined(HAVE_BASIC_PID_T) || !HAVE_BASIC_PID_T |
|||
# undef HAVE_BASIC_PID_T |
|||
# define HAVE_BASIC_PID_T 4 |
|||
#endif |
|||
#ifndef F_pid |
|||
# if HAVE_BASIC_PID_T==1 |
|||
#define F_pid "%hd" |
|||
# elif HAVE_BASIC_PID_T==2 |
|||
#define F_pid "%hu" |
|||
# elif HAVE_BASIC_PID_T==3 |
|||
#define F_pid "%""d" |
|||
# elif HAVE_BASIC_PID_T==4 |
|||
#define F_pid "%u" |
|||
# elif HAVE_BASIC_PID_T==5 |
|||
#define F_pid "%ld" |
|||
# elif HAVE_BASIC_PID_T==6 |
|||
#define F_pid "%lu" |
|||
# else |
|||
#error "HAVE_BASIC_PID_T is out of range:" HAVE_BASIC_PID_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* default: unsigned int */ |
|||
#if !defined(HAVE_BASIC_UID_T) || !HAVE_BASIC_UID_T |
|||
# undef HAVE_BASIC_UID_T |
|||
# define HAVE_BASIC_UID_T 4 |
|||
#endif |
|||
#ifndef F_uid |
|||
# if HAVE_BASIC_UID_T==1 |
|||
#define F_uid "%hd" |
|||
# elif HAVE_BASIC_UID_T==2 |
|||
#define F_uid "%hu" |
|||
# elif HAVE_BASIC_UID_T==3 |
|||
#define F_uid "%""d" |
|||
# elif HAVE_BASIC_UID_T==4 |
|||
#define F_uid "%u" |
|||
# elif HAVE_BASIC_UID_T==5 |
|||
#define F_uid "%ld" |
|||
# elif HAVE_BASIC_UID_T==6 |
|||
#define F_uid "%lu" |
|||
# else |
|||
#error "HAVE_BASIC_UID_T is out of range:" HAVE_BASIC_UID_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* default: unsigned int */ |
|||
#if !defined(HAVE_BASIC_GID_T) || !HAVE_BASIC_GID_T |
|||
# undef HAVE_BASIC_GID_T |
|||
# define HAVE_BASIC_GID_T 4 |
|||
#endif |
|||
#ifndef F_gid |
|||
# if HAVE_BASIC_GID_T==1 |
|||
#define F_gid "%hd" |
|||
# elif HAVE_BASIC_GID_T==2 |
|||
#define F_gid "%hu" |
|||
# elif HAVE_BASIC_GID_T==3 |
|||
#define F_gid "%""d" |
|||
# elif HAVE_BASIC_GID_T==4 |
|||
#define F_gid "%u" |
|||
# elif HAVE_BASIC_GID_T==5 |
|||
#define F_gid "%ld" |
|||
# elif HAVE_BASIC_GID_T==6 |
|||
#define F_gid "%lu" |
|||
# else |
|||
#error "HAVE_BASIC_GID_T is out of range:" HAVE_BASIC_GID_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* all signed; default: long */ |
|||
#if !defined(HAVE_BASIC_TIME_T) || !HAVE_BASIC_TIME_T |
|||
# undef HAVE_BASIC_TIME_T |
|||
# define HAVE_BASIC_TIME_T 5 |
|||
#endif |
|||
#ifndef F_time |
|||
# if HAVE_BASIC_TIME_T==1 |
|||
#define F_time "%hd" |
|||
# elif HAVE_BASIC_TIME_T==2 |
|||
#define F_time "%hu" |
|||
# elif HAVE_BASIC_TIME_T==3 |
|||
#define F_time "%""d" |
|||
# elif HAVE_BASIC_TIME_T==4 |
|||
#define F_time "%u" |
|||
# elif HAVE_BASIC_TIME_T==5 |
|||
#define F_time "%ld" |
|||
# elif HAVE_BASIC_TIME_T==6 |
|||
#define F_time "%lu" |
|||
# elif HAVE_BASIC_TIME_T==7 |
|||
#define F_time "%Ld" |
|||
# elif HAVE_BASIC_TIME_T==8 |
|||
#define F_time "%Lu" |
|||
# else |
|||
#error "HAVE_BASIC_TIME_T is out of range:" HAVE_BASIC_TIME_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* default: int */ |
|||
#if !defined(HAVE_BASIC_SOCKLEN_T) || !HAVE_BASIC_SOCKLEN_T |
|||
# undef HAVE_BASIC_SOCKLEN_T |
|||
# define HAVE_BASIC_SOCKLEN_T 3 |
|||
#endif |
|||
#ifndef F_socklen |
|||
# if HAVE_BASIC_SOCKLEN_T==1 |
|||
#define F_socklen "%hd" |
|||
# elif HAVE_BASIC_SOCKLEN_T==2 |
|||
#define F_socklen "%hu" |
|||
# elif HAVE_BASIC_SOCKLEN_T==3 |
|||
#define F_socklen "%""d" |
|||
# elif HAVE_BASIC_SOCKLEN_T==4 |
|||
#define F_socklen "%u" |
|||
# elif HAVE_BASIC_SOCKLEN_T==5 |
|||
#define F_socklen "%ld" |
|||
# elif HAVE_BASIC_SOCKLEN_T==6 |
|||
#define F_socklen "%lu" |
|||
# elif HAVE_BASIC_SOCKLEN_T==7 |
|||
#define F_socklen "%Ld" |
|||
# elif HAVE_BASIC_SOCKLEN_T==8 |
|||
#define F_socklen "%Lu" |
|||
# else |
|||
#error "HAVE_BASIC_SOCKLEN_T is out of range:" HAVE_BASIC_SOCKLEN_T |
|||
# endif |
|||
#endif |
|||
|
|||
#if !defined(HAVE_BASIC_OFF_T) || !HAVE_BASIC_OFF_T |
|||
# undef HAVE_BASIC_OFF_T |
|||
# define HAVE_BASIC_OFF_T 5 /*long*/ |
|||
#endif |
|||
#ifndef F_off |
|||
# if HAVE_BASIC_OFF_T==3 |
|||
# define F_off "%""d" |
|||
# elif HAVE_BASIC_OFF_T==5 |
|||
# define F_off "%ld" |
|||
# elif HAVE_BASIC_OFF_T==7 |
|||
# define F_off "%Ld" |
|||
# else |
|||
#error "HAVE_BASIC_OFF_T is out of range:" HAVE_BASIC_OFF_T |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: long long */ |
|||
#if !defined(HAVE_BASIC_OFF64_T) || !HAVE_BASIC_OFF64_T |
|||
# undef HAVE_BASIC_OFF64_T |
|||
# define HAVE_BASIC_OFF64_T 7 |
|||
#endif |
|||
#ifndef F_off64 |
|||
# if HAVE_BASIC_OFF64_T==1 |
|||
#define F_off64 "%hd" |
|||
# elif HAVE_BASIC_OFF64_T==2 |
|||
#define F_off64 "%hu" |
|||
# elif HAVE_BASIC_OFF64_T==3 |
|||
#define F_off64 "%""d" |
|||
# elif HAVE_BASIC_OFF64_T==4 |
|||
#define F_off64 "%u" |
|||
# elif HAVE_BASIC_OFF64_T==5 |
|||
#define F_off64 "%ld" |
|||
# elif HAVE_BASIC_OFF64_T==6 |
|||
#define F_off64 "%lu" |
|||
# elif HAVE_BASIC_OFF64_T==7 |
|||
#define F_off64 "%Ld" |
|||
# elif HAVE_BASIC_OFF64_T==8 |
|||
#define F_off64 "%Lu" |
|||
# else |
|||
#error "HAVE_BASIC_OFF64_T is out of range:" HAVE_BASIC_OFF64_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* all unsigned; default: unsigned long */ |
|||
#if !defined(HAVE_BASIC_DEV_T) || !HAVE_BASIC_DEV_T |
|||
# undef HAVE_BASIC_DEV_T |
|||
# define HAVE_BASIC_DEV_T 6 |
|||
#endif |
|||
#ifndef F_dev |
|||
# if HAVE_BASIC_DEV_T==1 |
|||
#define F_dev "%hd" |
|||
# elif HAVE_BASIC_DEV_T==2 |
|||
#define F_dev "%hu" |
|||
# elif HAVE_BASIC_DEV_T==3 |
|||
#define F_dev "%""d" |
|||
# elif HAVE_BASIC_DEV_T==4 |
|||
#define F_dev "%u" |
|||
# elif HAVE_BASIC_DEV_T==5 |
|||
#define F_dev "%ld" |
|||
# elif HAVE_BASIC_DEV_T==6 |
|||
#define F_dev "%lu" |
|||
# elif HAVE_BASIC_DEV_T==7 |
|||
#define F_dev "%Ld" |
|||
# elif HAVE_BASIC_DEV_T==8 |
|||
#define F_dev "%Lu" |
|||
# else |
|||
#error "HAVE_BASIC_DEV_T is out of range:" HAVE_BASIC_DEV_T |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
#if _WITH_TERMIOS |
|||
#if !defined(HAVE_BASIC_SPEED_T) || !HAVE_BASIC_SPEED_T |
|||
# undef HAVE_BASIC_SPEED_T |
|||
# define HAVE_BASIC_SPEED_T 4 |
|||
#endif |
|||
#ifndef F_speed |
|||
# if HAVE_BASIC_SPEED_T==1 |
|||
#define F_speed "%hd" |
|||
# elif HAVE_BASIC_SPEED_T==2 |
|||
#define F_speed "%hu" |
|||
# elif HAVE_BASIC_SPEED_T==3 |
|||
#define F_speed "%""d" |
|||
# elif HAVE_BASIC_SPEED_T==4 |
|||
#define F_speed "%u" |
|||
# elif HAVE_BASIC_SPEED_T==5 |
|||
#define F_speed "%ld" |
|||
# elif HAVE_BASIC_SPEED_T==6 |
|||
#define F_speed "%lu" |
|||
# elif HAVE_BASIC_SPEED_T==7 |
|||
#define F_speed "%Ld" |
|||
# elif HAVE_BASIC_SPEED_T==8 |
|||
#define F_speed "%Lu" |
|||
# else |
|||
#error "HAVE_BASIC_SPEED_T is out of range:" HAVE_BASIC_SPEED_T |
|||
# endif |
|||
#endif |
|||
#endif /* _WITH_TERMIOS */ |
|||
|
|||
/* all unsigned; default; unsigned long */ |
|||
#if !defined(HAVE_TYPEOF_ST_INO) || !HAVE_TYPEOF_ST_INO |
|||
# undef HAVE_TYPEOF_ST_INO |
|||
# define HAVE_TYPEOF_ST_INO 6 |
|||
#endif |
|||
#ifndef F_st_ino |
|||
# if HAVE_TYPEOF_ST_INO==1 |
|||
#define F_st_ino "%hd" |
|||
# elif HAVE_TYPEOF_ST_INO==2 |
|||
#define F_st_ino "%hu" |
|||
# elif HAVE_TYPEOF_ST_INO==3 |
|||
#define F_st_ino "%""d" |
|||
# elif HAVE_TYPEOF_ST_INO==4 |
|||
#define F_st_ino "%u" |
|||
# elif HAVE_TYPEOF_ST_INO==5 |
|||
#define F_st_ino "%ld" |
|||
# elif HAVE_TYPEOF_ST_INO==6 |
|||
#define F_st_ino "%lu" |
|||
# elif HAVE_TYPEOF_ST_INO==7 /* Cygwin 1.5 */ |
|||
#define F_st_ino "%Ld" |
|||
# elif HAVE_TYPEOF_ST_INO==8 |
|||
#define F_st_ino "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST_INO is out of range:" HAVE_TYPEOF_ST_INO |
|||
# endif |
|||
#endif |
|||
|
|||
/* all unsigned; default; unsigned long long */ |
|||
#if !defined(HAVE_TYPEOF_ST64_INO) || !HAVE_TYPEOF_ST64_INO |
|||
# undef HAVE_TYPEOF_ST64_INO |
|||
# define HAVE_TYPEOF_ST64_INO 8 |
|||
#endif |
|||
#ifndef F_st64_ino |
|||
# if HAVE_TYPEOF_ST64_INO==1 |
|||
#define F_st64_ino "%hd" |
|||
# elif HAVE_TYPEOF_ST64_INO==2 |
|||
#define F_st64_ino "%hu" |
|||
# elif HAVE_TYPEOF_ST64_INO==3 |
|||
#define F_st64_ino "%""d" |
|||
# elif HAVE_TYPEOF_ST64_INO==4 |
|||
#define F_st64_ino "%u" |
|||
# elif HAVE_TYPEOF_ST64_INO==5 |
|||
#define F_st64_ino "%ld" |
|||
# elif HAVE_TYPEOF_ST64_INO==6 |
|||
#define F_st64_ino "%lu" |
|||
# elif HAVE_TYPEOF_ST64_INO==7 |
|||
#define F_st64_ino "%Ld" |
|||
# elif HAVE_TYPEOF_ST64_INO==8 |
|||
#define F_st64_ino "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST64_INO is out of range:" HAVE_TYPEOF_ST64_INO |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: unsigned short */ |
|||
#if !defined(HAVE_TYPEOF_ST_NLINK) || !HAVE_TYPEOF_ST_NLINK |
|||
# undef HAVE_TYPEOF_ST_NLINK |
|||
# define HAVE_TYPEOF_ST_NLINK 2 |
|||
#endif |
|||
#ifndef F_st_nlink |
|||
# if HAVE_TYPEOF_ST_NLINK==1 |
|||
#define F_st_nlink "%hd" |
|||
# elif HAVE_TYPEOF_ST_NLINK==2 |
|||
#define F_st_nlink "%hu" |
|||
# elif HAVE_TYPEOF_ST_NLINK==3 |
|||
#define F_st_nlink "%""d" |
|||
# elif HAVE_TYPEOF_ST_NLINK==4 |
|||
#define F_st_nlink "%u" |
|||
# elif HAVE_TYPEOF_ST_NLINK==5 |
|||
#define F_st_nlink "%ld" |
|||
# elif HAVE_TYPEOF_ST_NLINK==6 |
|||
#define F_st_nlink "%lu" |
|||
# elif HAVE_TYPEOF_ST_NLINK==7 |
|||
#define F_st_nlink "%Ld" |
|||
# elif HAVE_TYPEOF_ST_NLINK==8 |
|||
#define F_st_nlink "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST_NLINK is out of range:" HAVE_TYPEOF_ST_NLINK |
|||
# endif |
|||
#endif |
|||
|
|||
/* all signed; default: long */ |
|||
#if !defined(HAVE_TYPEOF_ST_SIZE) || !HAVE_TYPEOF_ST_SIZE |
|||
# undef HAVE_TYPEOF_ST_SIZE |
|||
# define HAVE_TYPEOF_ST_SIZE 5 |
|||
#endif |
|||
#ifndef F_st_size |
|||
# if HAVE_TYPEOF_ST_SIZE==1 |
|||
#define F_st_size "%hd" |
|||
# elif HAVE_TYPEOF_ST_SIZE==2 |
|||
#define F_st_size "%hu" |
|||
# elif HAVE_TYPEOF_ST_SIZE==3 |
|||
#define F_st_size "%""d" |
|||
# elif HAVE_TYPEOF_ST_SIZE==4 |
|||
#define F_st_size "%u" |
|||
# elif HAVE_TYPEOF_ST_SIZE==5 |
|||
#define F_st_size "%ld" |
|||
# elif HAVE_TYPEOF_ST_SIZE==6 |
|||
#define F_st_size "%lu" |
|||
# elif HAVE_TYPEOF_ST_SIZE==7 |
|||
#define F_st_size "%Ld" |
|||
# elif HAVE_TYPEOF_ST_SIZE==8 |
|||
#define F_st_size "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST_SIZE is out of range:" HAVE_TYPEOF_ST_SIZE |
|||
# endif |
|||
#endif |
|||
|
|||
/* all signed; default: long long */ |
|||
#if !defined(HAVE_TYPEOF_ST64_SIZE) || !HAVE_TYPEOF_ST64_SIZE |
|||
# undef HAVE_TYPEOF_ST64_SIZE |
|||
# define HAVE_TYPEOF_ST64_SIZE 7 |
|||
#endif |
|||
#ifndef F_st64_size |
|||
# if HAVE_TYPEOF_ST64_SIZE==1 |
|||
#define F_st64_size "%hd" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==2 |
|||
#define F_st64_size "%hu" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==3 |
|||
#define F_st64_size "%""d" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==4 |
|||
#define F_st64_size "%u" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==5 |
|||
#define F_st64_size "%ld" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==6 |
|||
#define F_st64_size "%lu" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==7 |
|||
#define F_st64_size "%Ld" |
|||
# elif HAVE_TYPEOF_ST64_SIZE==8 |
|||
#define F_st64_size "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST64_SIZE is out of range:" HAVE_TYPEOF_ST64_SIZE |
|||
# endif |
|||
#endif |
|||
|
|||
/* very different results; default: long */ |
|||
#if !defined(HAVE_TYPEOF_ST_BLKSIZE) || !HAVE_TYPEOF_ST_BLKSIZE |
|||
# undef HAVE_TYPEOF_ST_BLKSIZE |
|||
# define HAVE_TYPEOF_ST_BLKSIZE 5 |
|||
#endif |
|||
#ifndef F_st_blksize |
|||
# if HAVE_TYPEOF_ST_BLKSIZE==1 |
|||
#define F_st_blksize "%hd" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==2 |
|||
#define F_st_blksize "%hu" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==3 |
|||
#define F_st_blksize "%""d" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==4 |
|||
#define F_st_blksize "%u" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==5 |
|||
#define F_st_blksize "%ld" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==6 |
|||
#define F_st_blksize "%lu" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==7 |
|||
#define F_st_blksize "%Ld" |
|||
# elif HAVE_TYPEOF_ST_BLKSIZE==8 |
|||
#define F_st_blksize "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST_BLKSIZE is out of range:" HAVE_TYPEOF_ST_BLKSIZE |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: long */ |
|||
#if !defined(HAVE_TYPEOF_ST_BLOCKS) || !HAVE_TYPEOF_ST_BLOCKS |
|||
# undef HAVE_TYPEOF_ST_BLOCKS |
|||
# define HAVE_TYPEOF_ST_BLOCKS 5 |
|||
#endif |
|||
#ifndef F_st_blocks |
|||
# if HAVE_TYPEOF_ST_BLOCKS==1 |
|||
#define F_st_blocks "%hd" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==2 |
|||
#define F_st_blocks "%hu" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==3 |
|||
#define F_st_blocks "%""d" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==4 |
|||
#define F_st_blocks "%u" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==5 |
|||
#define F_st_blocks "%ld" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==6 |
|||
#define F_st_blocks "%lu" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==7 |
|||
#define F_st_blocks "%Ld" |
|||
# elif HAVE_TYPEOF_ST_BLOCKS==8 |
|||
#define F_st_blocks "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST_BLOCKS is out of range:" HAVE_TYPEOF_ST_BLOCKS |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: long long */ |
|||
#if !defined(HAVE_TYPEOF_ST64_BLOCKS) || !HAVE_TYPEOF_ST64_BLOCKS |
|||
# undef HAVE_TYPEOF_ST64_BLOCKS |
|||
# define HAVE_TYPEOF_ST64_BLOCKS 7 |
|||
#endif |
|||
#ifndef F_st64_blocks |
|||
# if HAVE_TYPEOF_ST64_BLOCKS==1 |
|||
#define F_st64_blocks "%hd" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==2 |
|||
#define F_st64_blocks "%hu" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==3 |
|||
#define F_st64_blocks "%""d" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==4 |
|||
#define F_st64_blocks "%u" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==5 |
|||
#define F_st64_blocks "%ld" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==6 |
|||
#define F_st64_blocks "%lu" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==7 |
|||
#define F_st64_blocks "%Ld" |
|||
# elif HAVE_TYPEOF_ST64_BLOCKS==8 |
|||
#define F_st64_blocks "%Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_ST64_BLOCKS is out of range:" HAVE_TYPEOF_ST64_BLOCKS |
|||
# endif |
|||
#endif |
|||
|
|||
|
|||
/* at least for Linux */ |
|||
#define F_tv_sec "%ld" |
|||
|
|||
/* default: long */ |
|||
#if !defined(HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC) || !HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC |
|||
# undef HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC |
|||
# define HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC 5 |
|||
#endif |
|||
#ifndef F_tv_usec |
|||
# if HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==1 |
|||
#define F_tv_usec "%06hd" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==2 |
|||
#define F_tv_usec "%06hu" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==3 |
|||
#define F_tv_usec "%06d" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==4 |
|||
#define F_tv_usec "%06u" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==5 |
|||
#define F_tv_usec "%06ld" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==6 |
|||
#define F_tv_usec "%06lu" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==7 |
|||
#define F_tv_usec "%06Ld" |
|||
# elif HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC==8 |
|||
#define F_tv_usec "%06Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC is out of range:" HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: long */ |
|||
#if !defined(HAVE_TYPEOF_RLIM_MAX) || !HAVE_TYPEOF_RLIM_MAX |
|||
# undef HAVE_TYPEOF_RLIM_MAX |
|||
# define HAVE_TYPEOF_RLIM_MAX 5 |
|||
#endif |
|||
#ifndef F_rlim_max |
|||
# if HAVE_TYPEOF_RLIM_MAX==1 |
|||
#define F_rlim_max "hd" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==2 |
|||
#define F_rlim_max "hu" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==3 |
|||
#define F_rlim_max "d" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==4 |
|||
#define F_rlim_max "u" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==5 |
|||
#define F_rlim_max "ld" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==6 |
|||
#define F_rlim_max "lu" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==7 |
|||
#define F_rlim_max "Ld" |
|||
# elif HAVE_TYPEOF_RLIM_MAX==8 |
|||
#define F_rlim_max "Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_RLIM_MAX is out of range:" HAVE_TYPEOF_RLIM_MAX |
|||
# endif |
|||
#endif |
|||
|
|||
/* default: socklen_t */ |
|||
#if !defined(HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN) || !HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN |
|||
# undef HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN |
|||
# define HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN HAVE_BASIC_SOCKLEN_T |
|||
#endif |
|||
#ifndef F_cmsg_len |
|||
# if HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==1 |
|||
#define F_cmsg_len "%""hd" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==2 |
|||
#define F_cmsg_len "%""hu" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==3 |
|||
#define F_cmsg_len "%""d" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==4 |
|||
#define F_cmsg_len "%""u" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==5 |
|||
#define F_cmsg_len "%""ld" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==6 |
|||
#define F_cmsg_len "%""lu" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==7 |
|||
#define F_cmsg_len "%""Ld" |
|||
# elif HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN==8 |
|||
#define F_cmsg_len "%""Lu" |
|||
# else |
|||
#error "HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN is out of range:" HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN |
|||
# endif |
|||
#endif |
|||
|
|||
/* Cygwin 1.3.22 has the prototypes, but not the type... */ |
|||
#ifndef HAVE_TYPE_STAT64 |
|||
# undef HAVE_STAT64 |
|||
# undef HAVE_FSTAT64 |
|||
# undef HAVE_LSTAT64 |
|||
#endif |
|||
#ifndef HAVE_TYPE_OFF64 |
|||
# undef HAVE_LSEEK64 |
|||
# undef HAVE_FTRUNCATE64 |
|||
#endif |
|||
|
|||
#if !defined(NETDB_INTERNAL) && defined(h_NETDB_INTERNAL) |
|||
# define NETDB_INTERNAL h_NETDB_INTERNAL |
|||
#endif |
|||
|
|||
#ifndef INET_ADDRSTRLEN |
|||
# define INET_ADDRSTRLEN sizeof(struct sockaddr_in) |
|||
#endif |
|||
|
|||
#if !HAVE_PROTOTYPE_HSTRERROR |
|||
/* with MacOSX this is char * */ |
|||
extern const char *hstrerror(int); |
|||
#endif |
|||
|
|||
#endif /* !defined(__compat_h_included) */ |
|||
@ -0,0 +1,652 @@ |
|||
/* source: config.h.in */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __config_h_included |
|||
#define __config_h_included 1 |
|||
|
|||
/* Define to empty if the keyword does not work. */ |
|||
#undef const |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
#undef gid_t |
|||
|
|||
/* Define if your struct stat has st_blksize. */ |
|||
#undef HAVE_ST_BLKSIZE |
|||
|
|||
/* Define if your struct stat has st_blocks. */ |
|||
#undef HAVE_ST_BLOCKS |
|||
|
|||
/* Define if your struct stat has st_rdev. */ |
|||
#undef HAVE_ST_RDEV |
|||
|
|||
/* Define if you have the strftime function. */ |
|||
#undef HAVE_STRFTIME |
|||
|
|||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ |
|||
#undef HAVE_SYS_WAIT_H |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
#undef mode_t |
|||
|
|||
/* Define to `long' if <sys/types.h> doesn't define. */ |
|||
#undef off_t |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
#undef pid_t |
|||
|
|||
/* Define as the return type of signal handlers (int or void). */ |
|||
#undef RETSIGTYPE |
|||
|
|||
/* Define to `unsigned' if <sys/types.h> doesn't define. */ |
|||
#undef size_t |
|||
|
|||
/* Define if you have the ANSI C header files. */ |
|||
#undef STDC_HEADERS |
|||
|
|||
/* Define if you can safely include both <sys/time.h> and <time.h>. */ |
|||
#undef TIME_WITH_SYS_TIME |
|||
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */ |
|||
#undef uid_t |
|||
|
|||
/* Define if you have the putenv function. */ |
|||
#undef HAVE_PUTENV |
|||
|
|||
/* Define if your cc provides char **environ declaration. |
|||
This implies HAVE_VAR_ENVIRON */ |
|||
#undef HAVE_DECL_ENVIRON |
|||
|
|||
/* Define if you have the char **environ variable */ |
|||
#undef HAVE_VAR_ENVIRON |
|||
|
|||
/* Define if you have the select function. */ |
|||
#undef HAVE_SELECT |
|||
|
|||
/* Define if you have the poll function. */ |
|||
#undef HAVE_POLL |
|||
|
|||
/* Define if you have the socket function. */ |
|||
#undef HAVE_SOCKET |
|||
|
|||
/* Define if you have the strdup function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_strdup |
|||
|
|||
/* Define if you have the strerror function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_strerror |
|||
|
|||
/* Define if you have the strstr function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_strstr |
|||
|
|||
/* Define if you have the strtod function. */ |
|||
#undef HAVE_STRTOD |
|||
|
|||
/* Define if you have the strtol function. */ |
|||
#undef HAVE_STRTOL |
|||
|
|||
/* Define if you have the strtoul function. */ |
|||
#undef HAVE_STRTOUL |
|||
|
|||
/* Define if you have the uname function. */ |
|||
#undef HAVE_UNAME |
|||
|
|||
/* Define if you have the getpgid function. */ |
|||
#undef HAVE_GETPGID |
|||
|
|||
/* Define if you have the getsid function. */ |
|||
#undef HAVE_GETSID |
|||
|
|||
/* Define if you have the nanosleep function. */ |
|||
#undef HAVE_NANOSLEEP |
|||
|
|||
/* Define if you have the gethostbyname function. */ |
|||
#undef HAVE_GETHOSTBYNAME |
|||
|
|||
/* Define if you have the getaddrinfo function. */ |
|||
#undef HAVE_GETADDRINFO |
|||
|
|||
/* Define if you have the getipnodebyname function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_getipnodebyname |
|||
|
|||
/* Define if you have the setgroups function. */ |
|||
#undef HAVE_SETGROUPS |
|||
|
|||
/* Define if you have the inet_aton function. */ |
|||
#undef HAVE_INET_ATON |
|||
|
|||
/* Define if you have the memrchr function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_memrchr |
|||
|
|||
/* Define if you have the if_indextoname function. */ |
|||
#undef HAVE_PROTOTYPE_LIB_if_indextoname |
|||
|
|||
/* Define if you have the sigaction function */ |
|||
#undef HAVE_SIGACTION |
|||
|
|||
/* Define if you have the stat64 function */ |
|||
#undef HAVE_STAT64 |
|||
|
|||
/* Define if you have the fstat64 function */ |
|||
#undef HAVE_FSTAT64 |
|||
|
|||
/* Define if you have the lstat64 function */ |
|||
#undef HAVE_LSTAT64 |
|||
|
|||
/* Define if you have the lseek64 function */ |
|||
#undef HAVE_LSEEK64 |
|||
|
|||
/* Define if you have the truncate64 function */ |
|||
#undef HAVE_TRUNCATE64 |
|||
|
|||
/* Define if you have the ftruncate64 function */ |
|||
#undef HAVE_FTRUNCATE64 |
|||
|
|||
/* Define if you have the clock_gettime function */ |
|||
#undef HAVE_CLOCK_GETTIME |
|||
|
|||
/* Define if you have the strtoll function */ |
|||
#undef HAVE_STRTOLL |
|||
|
|||
/* Define if you have the hstrerror function */ |
|||
#undef HAVE_HSTRERROR |
|||
|
|||
/* Define if you have the inet_ntop function */ |
|||
#undef HAVE_INET_NTOP |
|||
|
|||
/* Define if you have the hstrerror prototype */ |
|||
#undef HAVE_PROTOTYPE_HSTRERROR |
|||
|
|||
/* Define if you have the <stdbool.h> header file. */ |
|||
#undef HAVE_STDBOOL_H |
|||
|
|||
/* Define if you have the <inttypes.h> header file. */ |
|||
#undef HAVE_INTTYPES_H |
|||
|
|||
/* Define if you have the <fcntl.h> header file. */ |
|||
#undef HAVE_FCNTL_H |
|||
|
|||
/* Define if you have the <limits.h> header file. */ |
|||
#undef HAVE_LIMITS_H |
|||
|
|||
/* Define if you have the <strings.h> header file. */ |
|||
#undef HAVE_STRINGS_H |
|||
|
|||
/* Define if you have the <sys/param.h> header file. */ |
|||
#undef HAVE_SYS_PARAM_H |
|||
|
|||
/* Define if you have the <sys/ioctl.h> header file. */ |
|||
#undef HAVE_SYS_IOCTL_H |
|||
|
|||
/* Define if you have the <sys/time.h> header file. */ |
|||
#undef HAVE_SYS_TIME_H |
|||
|
|||
/* Define if you have the <syslog.h> header file. */ |
|||
#undef HAVE_SYSLOG_H |
|||
|
|||
/* Define if you have the <unistd.h> header file. */ |
|||
#undef HAVE_UNISTD_H |
|||
|
|||
/* Define if you have the <pwd.h> header file. */ |
|||
#undef HAVE_PWD_H |
|||
|
|||
/* Define if you have the <grp.h> header file. */ |
|||
#undef HAVE_GRP_H |
|||
|
|||
/* Define if you have the <stdint.h> header file. */ |
|||
#undef HAVE_STDINT_H |
|||
|
|||
/* Define if you have the <sys/types.h> header file. */ |
|||
#undef HAVE_SYS_TYPES_H |
|||
|
|||
/* Define if you have the <poll.h> header file. */ |
|||
#undef HAVE_POLL_H |
|||
|
|||
/* Define if you have the <sys/poll.h> header file. */ |
|||
#undef HAVE_SYS_POLL_H |
|||
|
|||
/* Define if you have the <sys/socket.h> header file. */ |
|||
#undef HAVE_SYS_SOCKET_H |
|||
|
|||
/* Define if you have the <sys/uio.h> header file. */ |
|||
#undef HAVE_SYS_UIO_H |
|||
|
|||
/* Define if you have the <sys/stat.h> header file. */ |
|||
#undef HAVE_SYS_STAT_H |
|||
|
|||
/* Define if you have the <netdb.h> header file. */ |
|||
#undef HAVE_NETDB_H |
|||
|
|||
/* Define if you have the <sys/un.h> header file. */ |
|||
#undef HAVE_SYS_UN_H |
|||
|
|||
/* Define if you have the <pty.h> header file. */ |
|||
#undef HAVE_PTY_H |
|||
|
|||
/* Define if you have the <netinet/in.h> header file. */ |
|||
#undef HAVE_NETINET_IN_H |
|||
|
|||
/* Define if you have the <netinet/in_systm.h> header file. */ |
|||
#undef HAVE_NETINET_IN_SYSTM_H |
|||
|
|||
/* Define if you have the <netinet/ip.h> header file. */ |
|||
#undef HAVE_NETINET_IP_H |
|||
|
|||
/* Define if you have the <netinet/tcp.h> header file. */ |
|||
#undef HAVE_NETINET_TCP_H |
|||
|
|||
/* Define if you have the <netinet/ip6.h> header file. */ |
|||
#undef HAVE_NETINET_IP6_H |
|||
|
|||
/* Define if you have the <netinet6/in6.h> header file. */ |
|||
#undef HAVE_NETINET6_IN6_H |
|||
|
|||
/* Define if you have the <arpa/nameser.h> header file. */ |
|||
#undef HAVE_ARPA_NAMESER_H |
|||
|
|||
/* Define if you have the <resolv.h> header file. */ |
|||
#undef HAVE_RESOLV_H |
|||
|
|||
/* Define if you have the <termios.h> header file. */ |
|||
#undef HAVE_TERMIOS_H |
|||
|
|||
/* Define if you have the <net/if.h> header file. */ |
|||
#undef HAVE_NET_IF_H |
|||
|
|||
/* Define if you have the <net/if_dl.h> header file. */ |
|||
#undef HAVE_NET_IF_DL_H |
|||
|
|||
/* Define if you have the <linux/types.h> header file. */ |
|||
#undef HAVE_LINUX_TYPES_H |
|||
|
|||
/* Define if you have the <linux/errqueue.h> header file. */ |
|||
#undef HAVE_LINUX_ERRQUEUE_H |
|||
|
|||
/* Define if you have the <linux/if_tun.h> header file. */ |
|||
#undef HAVE_LINUX_IF_TUN_H |
|||
|
|||
/* Define if you have the <netpacket/packet.h> header file. */ |
|||
#undef HAVE_NETPACKET_PACKET_H |
|||
|
|||
/* Define if you have the <netinet/if_ether.h> header file. */ |
|||
#undef HAVE_NETINET_IF_ETHER_H |
|||
|
|||
/* Define if you have the <sys/utsname.h> header file. */ |
|||
#undef HAVE_SYS_UTSNAME_H |
|||
|
|||
/* Define if you have the <sys/select.h> header file. (AIX) */ |
|||
#undef HAVE_SYS_SELECT_H |
|||
|
|||
/* Define if you have the <sys/file.h> header file. (AIX) */ |
|||
#undef HAVE_SYS_FILE_H |
|||
|
|||
/* Define if you have the <util.h> header file. (NetBSD, OpenBSD: openpty()) */ |
|||
#undef HAVE_UTIL_H |
|||
|
|||
/* Define if you have the <bsd/libutil.h> header file. */ |
|||
#undef HAVE_BSD_LIBUTIL_H |
|||
|
|||
/* Define if you have the <libutil.h> header file. (FreeBSD: openpty()) */ |
|||
#undef HAVE_LIBUTIL_H |
|||
|
|||
/* Define if you have the <sys/stropts.h> header file. (stream opts on SunOS)*/ |
|||
#undef HAVE_SYS_STROPTS_H |
|||
|
|||
/* Define if you have the <regex.h> header file. */ |
|||
#undef HAVE_REGEX_H |
|||
|
|||
/* Define if you have the <linux/fs.h> header file. */ |
|||
#undef HAVE_LINUX_FS_H |
|||
|
|||
/* Define if you have the <linux/ext2_fs.h> header file. */ |
|||
#undef HAVE_LINUX_EXT2_FS_H |
|||
|
|||
/* Define if you have the <readline/readline.h> header file. */ |
|||
#undef HAVE_READLINE_READLINE_H |
|||
|
|||
/* Define if you have the <readline/history.h> header file. */ |
|||
#undef HAVE_READLINE_HISTORY_H |
|||
|
|||
/* Define if you have the readline library. */ |
|||
#undef HAVE_LIBREADLINE |
|||
|
|||
/* Define if you have the m library (-lm). */ |
|||
#undef HAVE_LIBM |
|||
|
|||
/* Define if you have the floor function */ |
|||
#undef HAVE_FLOOR |
|||
|
|||
/* some platforms need _XOPEN_EXTENDED_SOURCE to get syslog headers (AIX4.1) */ |
|||
#undef _XOPEN_EXTENDED_SOURCE |
|||
|
|||
/* fdset may have component fds_bits or __fds_bits */ |
|||
#undef HAVE_FDS_BITS |
|||
|
|||
/* struct termios may have components c_ispeed,c_ospeed */ |
|||
#undef HAVE_STRUCT_TERMIOS_C_ISPEED |
|||
#undef HAVE_STRUCT_TERMIOS_C_OSPEED |
|||
|
|||
/* Define if you have the sa_family_t */ |
|||
#undef HAVE_TYPE_SA_FAMILY_T |
|||
|
|||
/* define if your struct sigaction has sa_sigaction */ |
|||
#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION |
|||
|
|||
/* define if you have struct sock_extended_err */ |
|||
#undef HAVE_STRUCT_SOCK_EXTENDED_ERR |
|||
|
|||
/* Define if your termios.h likes _SVID3 defined */ |
|||
#undef _SVID3 |
|||
|
|||
/* Define if your sys/socket.h likes _XPG4_2 defined */ |
|||
#undef _XPG4_2 |
|||
|
|||
/* Define if your ctime_r() choices need _POSIX_PTHREAD_SEMANTICS */ |
|||
#undef _POSIX_PTHREAD_SEMANTICS |
|||
|
|||
/* Define if you need __EXTENSIONS__ */ |
|||
#undef __EXTENSIONS__ |
|||
|
|||
/* Define if you have struct timespec (e.g. for nanosleep) */ |
|||
#undef HAVE_STRUCT_TIMESPEC |
|||
|
|||
/* Define if you have struct linger */ |
|||
#undef HAVE_STRUCT_LINGER |
|||
|
|||
/* Define if you have struct ip */ |
|||
#undef HAVE_STRUCT_IP |
|||
|
|||
/* Define if you have struct ip_mreq */ |
|||
#undef HAVE_STRUCT_IP_MREQ |
|||
|
|||
/* Define if you have struct ip_mreqn */ |
|||
#undef HAVE_STRUCT_IP_MREQN |
|||
|
|||
/* Define if you have struct ipv6_mreq */ |
|||
#undef HAVE_STRUCT_IPV6_MREQ |
|||
|
|||
/* Define if you have struct ifreq */ |
|||
#undef HAVE_STRUCT_IFREQ |
|||
|
|||
/* Define if you have struct ifreq.ifr_index */ |
|||
#undef HAVE_STRUCT_IFREQ_IFR_INDEX |
|||
|
|||
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */ |
|||
#undef HAVE_STRUCT_IFREQ_IFR_IFINDEX |
|||
|
|||
/* Define if your struct sockaddr has sa_len */ |
|||
#undef HAVE_STRUCT_SOCKADDR_SALEN |
|||
|
|||
/* there are several implementations of sockaddr_in6 */ |
|||
#undef HAVE_IP6_SOCKADDR |
|||
|
|||
/* Define if you have struct iovec */ |
|||
#undef HAVE_STRUCT_IOVEC |
|||
|
|||
/* define if your struct msghdr has msg_control */ |
|||
#undef HAVE_STRUCT_MSGHDR_MSGCONTROL |
|||
|
|||
/* define if your struct msghdr has msg_controllen */ |
|||
#undef HAVE_STRUCT_MSGHDR_MSGCONTROLLEN |
|||
|
|||
/* define if your struct msghdr has msg_flag */ |
|||
#undef HAVE_STRUCT_MSGHDR_MSGFLAGS |
|||
|
|||
/* define if you have struct cmsghdr */ |
|||
#undef HAVE_STRUCT_CMSGHDR |
|||
|
|||
/* define if you have struct in_pktinfo */ |
|||
#undef HAVE_STRUCT_IN_PKTINFO |
|||
|
|||
/* define if your struct in_pktinfo has component ipi_spec_dst */ |
|||
#undef HAVE_PKTINFO_IPI_SPEC_DST |
|||
|
|||
/* define if you have struct in6_pktinfo */ |
|||
#undef HAVE_STRUCT_IN6_PKTINFO |
|||
|
|||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */ |
|||
#undef HAVE_STRUCT_IP_IP_HL |
|||
|
|||
/* Define if you have the setenv function */ |
|||
#undef HAVE_SETENV |
|||
|
|||
/* Define if you have the unsetenv function. not on HP-UX */ |
|||
#undef HAVE_UNSETENV |
|||
|
|||
/* Define if you have the cfsetispeed,cfgetispeed,cfsetspeed,cfgetospeed function */ |
|||
#undef HAVE_CFSETISPEED |
|||
#undef HAVE_CFSETOSPEED |
|||
|
|||
#if HAVE_CFSETISPEED |
|||
# define HAVE_TERMIOS_ISPEED 1 |
|||
#endif |
|||
#if HAVE_CFSETOSPEED |
|||
# define HAVE_TERMIOS_OSPEED 1 |
|||
#endif |
|||
#if defined(HAVE_TERMIOS_ISPEED) && defined(HAVE_TERMIOS_OSPEED) |
|||
# define HAVE_TERMIOS_SPEED 1 |
|||
#endif |
|||
|
|||
/* Define if you have the SSLv2 client and server method functions. not in new openssl */ |
|||
#undef HAVE_SSLv2_client_method |
|||
#undef HAVE_SSLv2_server_method |
|||
|
|||
/* Define if you have the HAVE_SSL_CTX_set_default_verify_paths function */ |
|||
#undef HAVE_SSL_CTX_set_default_verify_paths |
|||
|
|||
/* Define if you have the TLS client and server method functions. not in old openssl? */ |
|||
#undef HAVE_TLS_client_method |
|||
#undef HAVE_TLS_server_method |
|||
|
|||
/* Define if you have the SSLv3 client and server method functions. not in new openssl */ |
|||
#undef HAVE_SSLv3_client_method |
|||
#undef HAVE_SSLv3_server_method |
|||
|
|||
/* Define if you have the SSLv3 client and server method functions with rollback to v2 */ |
|||
#undef HAVE_SSLv23_client_method |
|||
#undef HAVE_SSLv23_server_method |
|||
|
|||
/* Define if you have the TLSv1.0 client and server method functions */ |
|||
#undef HAVE_TLSv1_client_method |
|||
#undef HAVE_TLSv1_server_method |
|||
|
|||
/* Define if you have the TLSv1.1 client and server method functions */ |
|||
#undef HAVE_TLSv1_1_client_method |
|||
#undef HAVE_TLSv1_1_server_method |
|||
|
|||
/* Define if you have the TLSv1.2 client and server method functions */ |
|||
#undef HAVE_TLSv1_2_client_method |
|||
#undef HAVE_TLSv1_2_server_method |
|||
|
|||
/* Define if you have the DTLSv1 client and server method functions */ |
|||
#undef HAVE_DTLSv1_client_method |
|||
#undef HAVE_DTLSv1_server_method |
|||
|
|||
/* Define if you have the EC_KEY type */ |
|||
#undef HAVE_TYPE_EC_KEY |
|||
|
|||
/* Define if you have the OpenSSL RAND_egd function */ |
|||
#undef HAVE_RAND_egd |
|||
|
|||
/* Define if you have the OpenSSL RAND_status function */ |
|||
#undef HAVE_RAND_status |
|||
|
|||
/* Define if you have the OpenSSL DH_set0_pqg function */ |
|||
#undef HAVE_DH_set0_pqg |
|||
|
|||
/* Define if you have the OpenSSL ASN1_STRING_get0_data function */ |
|||
#undef HAVE_ASN1_STRING_get0_data |
|||
|
|||
/* Define if you have the OpenSSL SSL_CTX_clear_mode macro or function */ |
|||
#undef HAVE_SSL_CTX_clear_mode |
|||
|
|||
/* Define if you have the flock function */ |
|||
#undef HAVE_FLOCK |
|||
|
|||
/* Define if you have the openpty function */ |
|||
#undef HAVE_OPENPTY |
|||
|
|||
/* Define if you have the grantpt function */ |
|||
#undef HAVE_GRANTPT |
|||
|
|||
/* Define if you have the unlockpt function */ |
|||
#undef HAVE_UNLOCKPT |
|||
|
|||
/* Define if you have the ptsname function */ |
|||
#undef HAVE_PROTOTYPE_LIB_ptsname |
|||
|
|||
/* Define if you have the /dev/ptmx pseudo terminal multiplexer */ |
|||
#undef HAVE_DEV_PTMX |
|||
|
|||
/* Define if you have the /dev/ptc pseudo terminal multiplexer */ |
|||
#undef HAVE_DEV_PTC |
|||
|
|||
/* Define if you have the cfmakeraw() function */ |
|||
#undef HAVE_CFMAKERAW |
|||
|
|||
/* Define if you have the long long type */ |
|||
#undef HAVE_TYPE_LONGLONG |
|||
|
|||
/* is sig_atomic_t declared */ |
|||
#undef HAVE_TYPE_SIG_ATOMIC_T |
|||
|
|||
/* is bool already typedef'd? */ |
|||
#undef HAVE_TYPE_BOOL |
|||
|
|||
/* is socklen_t already typedef'd? */ |
|||
#undef HAVE_TYPE_SOCKLEN |
|||
|
|||
/* Define if you have the struct stat64 type */ |
|||
#undef HAVE_TYPE_STAT64 |
|||
|
|||
/* Define if you have the struct off64_t type */ |
|||
#undef HAVE_TYPE_OFF64 |
|||
|
|||
/* is sighandler_t already typedef'd? */ |
|||
#undef HAVE_TYPE_SIGHANDLER |
|||
|
|||
/* is uint8_t already defined? */ |
|||
#undef HAVE_TYPE_UINT8 |
|||
|
|||
/* is uint16_t already defined? */ |
|||
#undef HAVE_TYPE_UINT16 |
|||
|
|||
/* is uint32_t already defined? */ |
|||
#undef HAVE_TYPE_UINT32 |
|||
|
|||
/* is uint64_t already defined? */ |
|||
#undef HAVE_TYPE_UINT64 |
|||
|
|||
/* Define if snprintf() returns required len on truncation (C-99 conform) */ |
|||
#undef HAVE_C99_SNPRINTF |
|||
|
|||
/* Define if you have the printf "Z" modifier */ |
|||
#undef HAVE_FORMAT_Z |
|||
|
|||
/* Define the shift offset of the CRDLY mask */ |
|||
#undef CRDLY_SHIFT |
|||
|
|||
/* Define the shift offset of the TABDLY mask */ |
|||
#undef TABDLY_SHIFT |
|||
|
|||
/* Define the shift offset of the CSIZE mask */ |
|||
#undef CSIZE_SHIFT |
|||
|
|||
/* Define if you have tcpwrappers (libwrap, tcpd) and it declares hosts_allow_table */ |
|||
#undef HAVE_HOSTS_ALLOW_TABLE |
|||
#if defined(HAVE_HOSTS_ALLOW_TABLE) && HAVE_HOSTS_ALLOW_TABLE |
|||
# define HAVE_HOSTS_DENY_TABLE 1 |
|||
#else |
|||
# undef HAVE_HOSTS_DENY_TABLE |
|||
#endif |
|||
|
|||
/* 1..short, 3..int, 5..long; 2,4,6..unsigned */ |
|||
#undef HAVE_BASIC_SIZE_T |
|||
#undef HAVE_BASIC_MODE_T |
|||
#undef HAVE_BASIC_PID_T |
|||
#undef HAVE_BASIC_UID_T |
|||
#undef HAVE_BASIC_GID_T |
|||
#undef HAVE_BASIC_TIME_T |
|||
#undef HAVE_BASIC_OFF_T |
|||
#undef HAVE_BASIC_OFF64_T |
|||
#undef HAVE_BASIC_DEV_T |
|||
#undef HAVE_BASIC_SPEED_T |
|||
|
|||
#undef HAVE_BASIC_SOCKLEN_T |
|||
|
|||
#undef HAVE_TYPEOF_ST_INO |
|||
#undef HAVE_TYPEOF_ST_NLINK |
|||
#undef HAVE_TYPEOF_ST_SIZE |
|||
#undef HAVE_TYPEOF_ST_BLKSIZE |
|||
#undef HAVE_TYPEOF_ST_BLOCKS |
|||
|
|||
#undef HAVE_TYPEOF_ST64_DEV |
|||
#undef HAVE_TYPEOF_ST64_INO |
|||
#undef HAVE_TYPEOF_ST64_NLINK |
|||
#undef HAVE_TYPEOF_ST64_SIZE |
|||
#undef HAVE_TYPEOF_ST64_BLKSIZE |
|||
#undef HAVE_TYPEOF_ST64_BLOCKS |
|||
|
|||
#undef HAVE_TYPEOF_STRUCT_TIMEVAL_TV_USEC |
|||
|
|||
#undef HAVE_TYPEOF_RLIM_MAX |
|||
|
|||
#undef HAVE_TYPEOF_STRUCT_CMSGHDR_CMSG_LEN |
|||
|
|||
/* Define if you have the /proc filesystem */ |
|||
#undef HAVE_PROC_DIR |
|||
|
|||
/* Define if you have the /proc/$$/fd directories */ |
|||
#undef HAVE_PROC_DIR_FD |
|||
|
|||
#undef HAVE_SETGRENT |
|||
#undef HAVE_GETGRENT |
|||
#undef HAVE_ENDGRENT |
|||
#undef HAVE_GETGROUPLIST |
|||
|
|||
#undef WITH_HELP |
|||
#undef WITH_STDIO |
|||
#undef WITH_FDNUM |
|||
#undef WITH_FILE |
|||
#undef WITH_CREAT |
|||
#undef WITH_GOPEN |
|||
#undef WITH_TERMIOS |
|||
#undef WITH_PIPE |
|||
#undef WITH_UNIX |
|||
#undef WITH_ABSTRACT_UNIXSOCKET |
|||
#undef WITH_IP4 |
|||
#undef WITH_IP6 |
|||
#undef WITH_RAWIP |
|||
#undef WITH_GENERICSOCKET |
|||
#undef WITH_INTERFACE |
|||
#undef WITH_TCP |
|||
#undef WITH_UDP |
|||
#undef WITH_SCTP |
|||
#undef WITH_LISTEN |
|||
#undef WITH_SOCKS4 |
|||
#undef WITH_SOCKS4A |
|||
#undef WITH_PROXY |
|||
#undef WITH_EXEC |
|||
#undef WITH_SYSTEM |
|||
#undef WITH_READLINE |
|||
#undef WITH_TUN |
|||
#undef WITH_PTY |
|||
#undef WITH_EXT2 |
|||
#undef WITH_OPENSSL |
|||
#undef WITH_OPENSSL_METHOD |
|||
#undef WITH_RES_DEPRECATED /* AAONLY,PRIMARY */ |
|||
#define WITH_STREAMS 1 |
|||
#undef WITH_FIPS |
|||
#undef OPENSSL_FIPS |
|||
#undef WITH_LIBWRAP |
|||
#undef HAVE_TCPD_H |
|||
#undef HAVE_LIBWRAP |
|||
|
|||
#undef WITH_SYCLS |
|||
#undef WITH_FILAN |
|||
#undef WITH_RETRY |
|||
|
|||
#undef WITH_MSGLEVEL |
|||
|
|||
#define BUILD_DATE __DATE__ " " __TIME__ |
|||
|
|||
#endif /* !defined(__config_h_included) */ |
|||
19786
lib/hardware/socat-1.7.3.4/configure
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2024
lib/hardware/socat-1.7.3.4/configure.ac
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1 @@ |
|||
configure.ac |
|||
@ -0,0 +1,34 @@ |
|||
#! /bin/sh |
|||
# source: daemon.sh |
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES) |
|||
# Published under the GNU General Public License V.2, see file COPYING |
|||
|
|||
# This script assumes that you create group daemon1 and user daemon1 before. |
|||
# they need only the right to exist (no login etc.) |
|||
|
|||
# Note: this pid file mechanism is not robust! |
|||
|
|||
# You will adapt these variables |
|||
USER=daemon1 |
|||
GROUP=daemon1 |
|||
INIF=fwnonsec.domain.org |
|||
OUTIF=fwsec.domain.org |
|||
TARGET=w3.intra.domain.org |
|||
INPORT=80 |
|||
DSTPORT=80 |
|||
# |
|||
INOPTS="fork,setgid=$GROUP,setuid=$USER" |
|||
OUTOPTS= |
|||
PIDFILE=/var/run/socat-$INPORT.pid |
|||
OPTS="-d -d -lm" # notice to stderr, then to syslog |
|||
SOCAT=/usr/local/bin/socat |
|||
|
|||
if [ "$1" = "start" -o -z "$1" ]; then |
|||
|
|||
$SOCAT $OPTS tcp-l:$INPORT,bind=$INIF,$INOPTS tcp:$TARGET:$DSTPORT,bind=$OUTIF,$OUTOPTS </dev/null & |
|||
echo $! >$PIDFILE |
|||
|
|||
elif [ "$1" = "stop" ]; then |
|||
|
|||
/bin/kill $(/bin/cat $PIDFILE) |
|||
fi |
|||
@ -0,0 +1,229 @@ |
|||
/* source: dalan.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* idea of a low level data description language. currently only a most |
|||
primitive subset exists. */ |
|||
|
|||
#include "config.h" |
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#if HAVE_STDBOOL_H |
|||
#include <stdbool.h> |
|||
#endif |
|||
#include <ctype.h> |
|||
#include "dalan.h" |
|||
|
|||
/* test structure to find maximal alignment */ |
|||
static struct { |
|||
char a; |
|||
long double b; |
|||
} maxalign; |
|||
|
|||
/* test structure to find minimal alignment */ |
|||
static struct { |
|||
char a; |
|||
char b; |
|||
} minalign; |
|||
|
|||
/* test union to find kind of byte ordering */ |
|||
static union { |
|||
char a[2]; |
|||
short b; |
|||
} byteorder = { "01" }; |
|||
|
|||
struct dalan_opts_s dalan_opts = { |
|||
sizeof(int), |
|||
sizeof(short), |
|||
sizeof(long), |
|||
sizeof(char), |
|||
sizeof(float), |
|||
sizeof(double) |
|||
} ; |
|||
|
|||
/* fill the dalan_opts structure with machine dependent defaults values. */ |
|||
static void _dalan_dflts(struct dalan_opts_s *dlo) { |
|||
dlo->c_int = sizeof(int); |
|||
dlo->c_short = sizeof(short); |
|||
dlo->c_long = sizeof(long); |
|||
dlo->c_char = sizeof(char); |
|||
dlo->c_float = sizeof(float); |
|||
dlo->c_double = sizeof(double); |
|||
dlo->maxalign = (char *)&maxalign.b-&maxalign.a; |
|||
dlo->minalign = &minalign.b-&minalign.a; |
|||
dlo->byteorder = (byteorder.b!=7711); |
|||
} |
|||
|
|||
/* allocate a new dalan_opts structure, fills it with machine dependent |
|||
defaults values, and returns the pointer. */ |
|||
struct dalan_opts_s *dalan_props(void) { |
|||
struct dalan_opts_s *dlo; |
|||
dlo = malloc(sizeof(struct dalan_opts_s)); |
|||
if (dlo == NULL) { |
|||
return NULL; |
|||
} |
|||
_dalan_dflts(dlo); |
|||
return dlo; |
|||
} |
|||
|
|||
void dalan_init(void) { |
|||
_dalan_dflts(&dalan_opts); |
|||
} |
|||
|
|||
/* read data description from line, write result to data; do not write |
|||
so much data that *p exceeds n ! |
|||
p must be initialized to 0. |
|||
return 0 on success, |
|||
-1 if the data was cut due to n limit, |
|||
1 if a syntax error occurred |
|||
*p is a global data counter; especially it must be used when calculating |
|||
alignment. On successful return from the function *p must be actual! |
|||
*/ |
|||
int dalan(const char *line, char *data, size_t *p, size_t n) { |
|||
int align, mask, i, x; |
|||
size_t p1 = *p; |
|||
char c; |
|||
|
|||
/*fputs(line, stderr); fputc('\n', stderr);*/ |
|||
while (c = *line++) { |
|||
switch (c) { |
|||
case ' ': |
|||
case '\t': |
|||
case '\r': |
|||
case '\n': |
|||
break; |
|||
case ',': |
|||
align = 2; |
|||
while (*line == ',') { |
|||
align <<= 1; |
|||
++line; |
|||
} |
|||
mask = align - 1; /* create the bitmask */ |
|||
i = (align - (p1 & mask)) & mask; |
|||
while (i && p1<n) data[p1++] = 0, --i; |
|||
if (i) { *p = p1; return -1; } |
|||
break; |
|||
case ';': |
|||
align = dalan_opts.c_int; |
|||
mask = align - 1; |
|||
i = (align - (p1 & mask)) & mask; |
|||
while (i && p1<n) data[p1++] = 0, --i; |
|||
if (i) { *p = p1; return -1; } |
|||
break; |
|||
case '"': |
|||
while (1) { |
|||
switch (c = *line++) { |
|||
case '\0': fputs("unterminated string\n", stderr); |
|||
return 1; |
|||
case '"': |
|||
break; |
|||
case '\\': |
|||
if (!(c = *line++)) { |
|||
fputs("continuation line not implemented\n", stderr); |
|||
return 1; |
|||
} |
|||
switch (c) { |
|||
case 'n': c = '\n'; break; |
|||
case 'r': c = '\r'; break; |
|||
case 't': c = '\t'; break; |
|||
case 'f': c = '\f'; break; |
|||
case 'b': c = '\b'; break; |
|||
case 'a': c = '\a'; break; |
|||
#if 0 |
|||
case 'e': c = '\e'; break; |
|||
#else |
|||
case 'e': c = '\033'; break; |
|||
#endif |
|||
case '0': c = '\0'; break; |
|||
} |
|||
/* PASSTHROUGH */ |
|||
default: |
|||
if (p1 >= n) { *p = p1; return -1; } |
|||
data[p1++] = c; |
|||
continue; |
|||
} |
|||
if (c == '"') |
|||
break; |
|||
} |
|||
break; |
|||
case '\'': |
|||
switch (c = *line++) { |
|||
case '\0': fputs("unterminated character\n", stderr); |
|||
return 1; |
|||
case '\'': fputs("error in character\n", stderr); |
|||
return 1; |
|||
case '\\': |
|||
if (!(c = *line++)) { |
|||
fputs("continuation line not implemented\n", stderr); |
|||
return 1; |
|||
} |
|||
switch (c) { |
|||
case 'n': c = '\n'; break; |
|||
case 'r': c = '\r'; break; |
|||
case 't': c = '\t'; break; |
|||
case 'f': c = '\f'; break; |
|||
case 'b': c = '\b'; break; |
|||
case 'a': c = '\a'; break; |
|||
#if 0 |
|||
case 'e': c = '\e'; break; |
|||
#else |
|||
case 'e': c = '\033'; break; |
|||
#endif |
|||
} |
|||
/* PASSTHROUGH */ |
|||
default: |
|||
if (p1 >= n) { *p = p1; return -1; } |
|||
data[p1++] = c; |
|||
break; |
|||
} |
|||
if (*line != '\'') { |
|||
fputs("error in character termination\n", stderr); |
|||
*p = p1; return 1; |
|||
} |
|||
++line; |
|||
break; |
|||
#if LATER |
|||
case '0': |
|||
c = *line++; |
|||
if (c == 'x') { |
|||
/* hexadecimal */ ; |
|||
} else if (isdigit(c&0xff)) { |
|||
/* octal */ |
|||
} else { |
|||
/* it was only 0 */ |
|||
} |
|||
break; |
|||
#endif /* LATER */ |
|||
case 'x': |
|||
/* expecting hex data, must be an even number of digits!! */ |
|||
while (true) { |
|||
c = *line; |
|||
if (isdigit(c&0xff)) { |
|||
x = (c-'0') << 4; |
|||
} else if (isxdigit(c&0xff)) { |
|||
x = ((c&0x07) + 9) << 4; |
|||
} else |
|||
break; |
|||
++line; |
|||
c = *line; |
|||
if (isdigit(c&0xff)) { |
|||
x |= (c-'0'); |
|||
} else if (isxdigit(c&0xff)) { |
|||
x |= (c&0x07) + 9; |
|||
} else { |
|||
fputs("odd number of hexadecimal digits\n", stderr); |
|||
*p = p1; return 1; |
|||
} |
|||
++line; |
|||
if (p1 >= n) { *p = p1; return -1; } |
|||
data[p1++] = x; |
|||
} |
|||
break; |
|||
case 'A': case 'a': |
|||
case 'C': case 'c': |
|||
default: fprintf(stderr, "syntax error in \"%s\"\n", line-1); |
|||
return 1; |
|||
} |
|||
} |
|||
*p = p1; return 0; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
/* source: dalan.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __dalan_h_included |
|||
#define __dalan_h_included 1 |
|||
|
|||
#include "mytypes.h" |
|||
|
|||
/* machine properties and command line options */ |
|||
struct dalan_opts_s { |
|||
int c_int; /* natural int size / C int size */ |
|||
int c_short; /* C short size */ |
|||
int c_long; /* C long size */ |
|||
int c_char; /* C char size */ |
|||
int c_float; /* C float size */ |
|||
int c_double; /* C double size */ |
|||
int maxalign; /* maximal alignment (double after char) */ |
|||
int minalign; /* minimal alignment (char after char) */ |
|||
int byteorder; /* 0: Motorola, network, big endian; 1: Intel, little |
|||
endian */ |
|||
} ; |
|||
|
|||
extern struct dalan_opts_s dalan_opts; |
|||
|
|||
extern void dalan_init(void); |
|||
extern struct dalan_opts_s *dalan_props(void); |
|||
extern int dalan(const char *line, char *data, size_t *p, size_t n); |
|||
|
|||
#endif /* !defined(__dalan_h_included) */ |
|||
@ -0,0 +1,9 @@ |
|||
table { |
|||
empty-cells:show; |
|||
} |
|||
.frame { border-style:solid; border-width:4px; border-color:black; } |
|||
.shell { font-family:Courier; |
|||
padding:2px; padding-left:6px; padding-right:6px; |
|||
border-style:solid; border-width:1px; border-color:gray; |
|||
color:lightgreen; background-color:black; |
|||
} |
|||
@ -0,0 +1,327 @@ |
|||
<html><head> |
|||
<title>Generic sockets with Socat</title> |
|||
<link rel="stylesheet" type="text/css" href="dest-unreach.css"> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<h1>Generic sockets with Socat</h1> |
|||
|
|||
<h2>Introduction</h2> |
|||
<p>Beginning with version 1.7.0 socat provides means to freely control |
|||
important aspects of socket handling. This allows to experiment with socket |
|||
types and protocols that are not explicitely implemented in socat. |
|||
</p> |
|||
|
|||
<p>The related socat features fall into three major categories:<p> |
|||
|
|||
<ul> |
|||
<li>address options for changing socket parameters while using common |
|||
socket types: |
|||
<tt>pf (protocol-family), so-type (socktype), so-prototype (protocol)</tt> |
|||
</li> |
|||
<li>address options for setting arbitrary socket options: |
|||
<tt>setsockopt-int, setsockopt-string, setsockopt-bin</tt></li> |
|||
<li>address types for passing almost arbitrary parameters and address data to |
|||
the standard system calls: |
|||
<tt>socket-connect, socket-listen, socket-sendto, socket-recv, |
|||
socket-recvfrom, socket-datagram</tt></li> |
|||
</ul> |
|||
|
|||
<p>In practice this gives you two possibilities:</p> |
|||
|
|||
<p>If you want to cope with sockets staying within the usual domains ( = |
|||
protocol families = address families) which are IPv4, IPv6, UNIX/local, and |
|||
raw interface for socat 1.7.0, it is sufficient to learn about a couple of |
|||
<a href="#GENERIC_OPTIONS">address options</a> that allow to change default |
|||
parameters, and to apply generic socket options.</p> |
|||
|
|||
<p>For other address families socat provides <a |
|||
href="#GENERIC_ADDRESSES">generic socket addresses</a>. |
|||
</p> |
|||
|
|||
|
|||
<a name="GENERIC_OPTIONS"></a> |
|||
<h2>Generic socket options</h2> |
|||
|
|||
<h3>Example 1: DCCP communication</h3> |
|||
|
|||
<p>A relatively new communication protocol has been introduced in the Internet |
|||
community for which no socat address type has been implemented up to version |
|||
1.7.0 |
|||
(see <a href="http://www.ietf.org/html.charters/dccp-charter.html">IETF's |
|||
Datagram Congestion Control Protocol</a> |
|||
and <a href="http://www.linuxfoundation.org/en/Net:DCCP#python_support">Linux |
|||
foundation Net:DCCP</a> for more info). Taken that the |
|||
operating system implements DCCP, it is possible to use this protocol |
|||
with socat while just employing standard socket addresses and some options. |
|||
</p> |
|||
|
|||
<p>A simple server that accepts a DCCP connection, passes the arriving data to a |
|||
subprocess for converting upper case to lower case characters, and then |
|||
returns it to the client: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat TCP4-LISTEN:4096,reuseaddr,type=6,prototype=33 exec:'tr A-Z a-z',pty,raw,echo=0 |
|||
</span></span> |
|||
|
|||
<p>A simple client that sends some upper case characters to the server via DCCP |
|||
and prints what the server returns: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
echo ABCD |socat - TCP4-CONNECT:localhost:4096,type=6,prototype=33 |
|||
</span></span> |
|||
|
|||
<p>We choose the TCP4 addresses as base because it best matches the DCCP |
|||
requirements: |
|||
<ol> |
|||
<li>DCCP is (here) based on IPv4</li> |
|||
<li>DCCP is stream oriented and uses <tt>connect()</tt> and <tt>listen(); |
|||
accept()</tt> calls</li> |
|||
<li>DCCP protocol uses ports</li> |
|||
</ol> |
|||
</p> |
|||
|
|||
<p>Option <tt><a href="socat.html#OPTION_SO_TYPE">type</a>=6</tt> changes TCP's |
|||
<tt>SOCK_STREAM</tt> parameter to <tt>SOCK_DCCP</tt>, and <tt> |
|||
<a href="socat.html#OPTION_SO_PROTOTYPE">prototype</a>=33</tt> replaces the |
|||
default <tt>IPPROTO_TCP</tt> with <tt>IPPROTO_DCCP</tt>. |
|||
</p> |
|||
|
|||
<p>DCCP has an important parameter, the service code. It provides another |
|||
multiplexing layer beyond the protocol ports. The Linux implementation of DCCP |
|||
allows to set this parameter with code like <tt>setsocktopt(fd, SOL_DCCP, |
|||
DCCP_SOCKOPT_SERVICE, {1}, sizeof(int))</tt>. The equivalent generic socat |
|||
option is: <tt><a href="socat.html#OPTION_SETSOCKOPT_INT">setsockopt-int</a>=269:2:1</tt> for service code 1. |
|||
If the service codes on server and client do not match the <tt>connect()</tt> |
|||
operation fails with error:<p> |
|||
|
|||
<table border="1" bgcolor="e08080"><tr><td><tt>... E connect(3, AF=2 127.0.0.1:4096, 16): Invalid request code</tt></td></tr></table> |
|||
|
|||
<p>Please note that this examples works with IPv6 as well, you just need to |
|||
replace the TCP4 words with TCP6, and the IPv4 socket address with an |
|||
appropriate IPv6 socket address, e.g. <tt>[::1]</tt>! |
|||
</p> |
|||
|
|||
<a name="GENERIC_ADDRESSES"></a> |
|||
<h2>Generic socket addresses</h2> |
|||
|
|||
<p>socat's generic socket addresses are a more comprehensive mechanism that |
|||
allows to deal with protocol families whose socket addresses are not supported |
|||
by socat - no semantical parsing, no structured assignment to the struct |
|||
components are available. Instead, the socket address records for binding and |
|||
connecting/sending are specified in unstructured hexadecimal form. The |
|||
following example demonstrates this by performing simple data transfer over |
|||
raw AppleTalk protocol. |
|||
</p> |
|||
|
|||
<p>Note: I do not have any knowledge about AppleTalk. I just managed to |
|||
configure my Linux host to tolerate the creation of a receiving and a sending |
|||
socket. Don't blame me nor ask me for support if it does not work for you. |
|||
</p> |
|||
|
|||
<a name="EXAMPLE_APPLETALK"></a> |
|||
<h3>Enabling AppleTalk protocol</h3> |
|||
|
|||
<p>Install the <tt>netatalk</tt> package. Check that <tt>/etc/netatalk/atalkd.conf</tt> |
|||
has an entry like <tt>eth0 -phase 2 -net 0-65534 -addr 65280.243</tt>. The |
|||
last part is an arbitrary (?) host address, some of the following values must |
|||
fit it. Make sure the <tt>atalkd</tt> daemon is running. Run the AppleTalk |
|||
ping command: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
aecho 65280.243 |
|||
</span></span> |
|||
|
|||
<p>If you get an error like: |
|||
</p> |
|||
|
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>Device or resource busy</tt></td></tr></table> |
|||
|
|||
<p>then try to restart <tt>atalkd</tt>:</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
/etc/init.d/atalkd restart |
|||
</span></span> |
|||
|
|||
<p>When <tt>aecho</tt> works like <tt>ping</tt> you are ready for the next step. |
|||
</p> |
|||
|
|||
<h3>Example 2: AppleTalk datagram communication</h3> |
|||
|
|||
<p>We start a socat process with a receiver and echo service: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat SOCKET-RECVFROM:5:2:0:x40x00x0000x00x00x0000000000000000 PIPE |
|||
</span></span> |
|||
|
|||
<p>Then, in another shell on the same host, we start a client socket process |
|||
that sends data to the server and gets the answer: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
echo ABCD |socat - SOCKET-DATAGRAM:5:2:0:x40x00xff00xf3x00x0000000000000000 |
|||
</span></span> |
|||
|
|||
<p>The client process should print the data. |
|||
</p> |
|||
|
|||
<p>How did this work? The generic socat address has just used the system call |
|||
parameters that were provided on command line, without knowing anything about |
|||
AppleTalk sockets and protocol. The values 5, 2, and 0 are directly used for |
|||
the <tt>socket()</tt> call: they specify the domain (<tt>PF_APPLETALK=5</tt>), |
|||
socket type (<tt>SOCK_DGRAM=2</tt>), and no protocol (0) - values for Linux. |
|||
The long hex strings define the socket addresses. They can only be constructed |
|||
with knowledge of the underlying structure. In |
|||
<tt>/usr/include/linux/atalk.h</tt> we find the following declarations: |
|||
</p> |
|||
|
|||
<pre> |
|||
struct atalk_addr { |
|||
__be16 s_net; |
|||
__u8 s_node; |
|||
}; |
|||
|
|||
struct sockaddr_at { |
|||
sa_family_t sat_family; |
|||
__u8 sat_port; |
|||
struct atalk_addr sat_addr; |
|||
char sat_zero[8]; |
|||
</pre> |
|||
|
|||
<p>After rolling out <tt>atalk_addr</tt> and considering implicit padding by the |
|||
C programming language we get the following byte map: |
|||
</p> |
|||
|
|||
<table border="1"> |
|||
<tr><th>component</th><th>offset</th><th>length</th><th>value</th><th>meaning</th></tr> |
|||
<tr><td>sat_family</td><td>0</td><td>2</td><td>x0005</td><td>address family</td></tr> |
|||
<tr><td>sat_port</td><td>2</td><td>1</td><td>x40</td><td>port</td></tr> |
|||
<tr><td>-</td><td>3</td><td>1</td><td>x00</td><td>padding</td></tr> |
|||
<tr><td>sat_addr.s_net</td><td>4</td><td>2</td><td>xff00</td><td>network address</td></tr> |
|||
<tr><td>sat_addr.s_node</td><td>6</td><td>1</td><td>xf3</td><td>node address</td></tr> |
|||
<tr><td>-</td><td>7</td><td>1</td><td>x00</td><td>padding</td></tr> |
|||
<tr><td>sat_zero</td><td>8</td><td>8</td><td>x0000000000000000</td><td>padding</td></tr> |
|||
</table> |
|||
|
|||
<p>Note that hexadecimal ff00 is the same as decimal 65280, and hexadecimal xf3 |
|||
is the same as decimal 243 - these are the numbers specified in |
|||
<tt>atalkd.conf</tt>. |
|||
</p> |
|||
|
|||
<p>The address family component must be omitted from the socket address because |
|||
it is added by socat implicitely. The resulting hexadecimal representation of |
|||
the target socket address is therefore: |
|||
</p> |
|||
<tt>x40x00xff00xf3x00x0000000000000000</tt> |
|||
|
|||
<p>The receiver just has to specify the port, so its bind address data is: |
|||
</p> |
|||
<tt>x40x00x0000x00x00x0000000000000000</tt> |
|||
|
|||
<h2>Parameters for well known socket types</h2> |
|||
|
|||
<p>Finding the correct parameters and socket addresses is not always trivial. |
|||
Therefore this section provides tables with the parameters of common socket |
|||
types. Some of these types are directly implemented by socat (and other |
|||
programs). Establishing interoperability between a directly implemented |
|||
socket and a generic socket might be your first step before entering unknown |
|||
ground.</p> |
|||
|
|||
<h3>Socket parameters</h3> |
|||
|
|||
<h4>Table: parameter names for "well known" sockets:</h4> |
|||
|
|||
<table border=1> |
|||
<tr><th>name</th><th>domain</th><th>socktype</th><th>protocol</th><th> </th><th>level</th><th>remark</th></tr> |
|||
<tr><td>UDP4</td><td>PF_INET</td><td>SOCK_DGRAM</td><td>IPPROTO_UDP</td><td> </td><td>SOL_UDP</td><td></td></tr> |
|||
<tr><td>UDP6</td><td>PF_INET6</td><td>SOCK_DGRAM</td><td>IPPROTO_UDP</td><td> </td><td>SOL_UDP</td><td></td></tr> |
|||
<tr><td>raw IPv4</td><td>PF_INET</td><td>SOCK_RAW</td><td>IPPROTO_RAW</td><td> </td><td>SOL_IP</td><td></td></tr> |
|||
<tr><td>raw IPv6</td><td>PF_INET6</td><td>SOCK_RAW</td><td>IPPROTO_RAW</td><td> </td><td>SOL_IPV6</td><td></td></tr> |
|||
<tr><td>UNIX</td><td>PF_LOCAL</td><td>SOCK_DGRAM</td><td>0</td><td> </td><td>SOL_SOCKET</td><td> </td></tr> |
|||
<tr><td>PACKET</td><td>PF_PACKET</td><td>SOCK_RAW</td><td>768</td><td></td><td>SOL_PACKET</td><td>tcpdump (include layer 2 header)</td></tr> |
|||
<tr><td>PACKET</td><td>PF_PACKET</td><td>SOCK_DGRAM</td><td>768</td><td></td><td>SOL_PACKET</td><td>no level 2 header</td></tr> |
|||
<tr><td>SCTP4</td><td>PF_INET</td><td>SOCK_SEQPACKET</td><td>IPPROTO_SCTP</td><td> </td><td>SOL_SCTP</td><td> </td></tr> |
|||
</table> |
|||
|
|||
<h4>Table: parameter values:</h4> |
|||
|
|||
<table border=1> |
|||
<tr><th>name</th><th>Linux</th><th>FreeBSD</th><th>NetBSD</th><th>OpenBSD</th><th>Solaris</th><th>AIX</th><th>Cygwin</th><th>Mac OS X</th><th>HP-UX</th></tr> |
|||
<tr><td>PF_LOCAL</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr> |
|||
<tr><td>PF_INET</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr> |
|||
<tr><td>PF_APPLETALK</td><td>5</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td></tr> |
|||
<tr><td>PF_INET6</td><td>10</td><td>28</td><td>24</td><td>24</td><td>26</td><td>24</td><td>-</td><td>30</td><td>22</td></tr> |
|||
<tr><td>PF_PACKET</td><td>17</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>SOCK_STREAM</td><td>1</td><td>1</td><td>1</td><td>1</td><td>2</td><td>1</td><td>1</td><td>1</td><td>1</td></tr> |
|||
<tr><td>SOCK_DGRAM</td><td>2</td><td>2</td><td>2</td><td>2</td><td>1</td><td>2</td><td>2</td><td>2</td><td>2</td></tr> |
|||
<tr><td>SOCK_RAW</td><td>3</td><td>3</td><td>3</td><td>3</td><td>4</td><td>3</td><td>3</td><td>3</td><td>3</td></tr> |
|||
<tr><td>SOCK_SEQPACKET</td><td>5</td><td>5</td><td>5</td><td>5</td><td>6</td><td>5</td><td>5</td><td>5</td><td>5</td></tr> |
|||
<tr><td>SOCK_DCCP</td><td>(6)</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>SOCK_PACKET</td><td>10</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>IPPROTO_IP</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> |
|||
<tr><td>IPPROTO_TCP</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td></tr> |
|||
<tr><td>IPPROTO_UDP</td><td>17</td><td>17</td><td>17</td><td>17</td><td>17</td><td>17</td><td>17</td><td>17</td><td>17</td></tr> |
|||
<tr><td>IPPROTO_DCCP</td><td>33</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>IPPROTO_SCTP</td><td>132</td><td>132</td><td>-</td><td>-</td><td>132</td><td>132</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>IPPROTO_RAW</td><td>255</td><td>255</td><td>255</td><td>255</td><td>255</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>SOL_SOCKET</td><td>1</td><td>65535</td><td>65535</td><td>65535</td><td>65535</td><td>65535</td><td>65535</td><td>65535</td><td>65535</td></tr> |
|||
<tr><td>SOL_IP</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> |
|||
<tr><td>SOL_TCP</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td><td>6</td></tr> |
|||
<tr><td>SOL_UDP</td><td>17</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>17</td><td>-</td><td>-</td></tr> |
|||
<tr><td>SOL_IPV6</td><td>41</td><td>41</td><td>41</td><td>41</td><td>41</td><td>41</td><td>-</td><td>41</td><td>41</td></tr> |
|||
<tr><td>SOL_PACKET</td><td>263</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
<tr><td>SOL_DCCP</td><td>269</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr> |
|||
</table> |
|||
|
|||
|
|||
<h3>Socket address specifications</h3> |
|||
|
|||
<p>These hexadecimal data define socket addresses for local and remote sockets, |
|||
and for bind and range options. The basis is the <tt>struct sockaddr_*</tt> for |
|||
the respective address family that should be declared in the C include files. |
|||
Please keep in mind that their first two bytes (<tt>sa_family</tt> and - on BSD |
|||
- <tt>sa_len</tt>) are implicitely prepended by socat.</p> |
|||
|
|||
<h4>Linux on 32bit Intel:</h4> |
|||
|
|||
<table border=1> |
|||
<tr><th>name</th><th>socket address type (without leading address family)</th><th>binary specification</th></tr> |
|||
<tr><td>IPv4</td><td>2 bytes port, 4 bytes IPv4 addr, 8 bytes 0</td><td>x0016 |
|||
x7f000001 x0000000000000000</td></tr> |
|||
<tr><td>IPv6</td><td>2 bytes port, 4 bytes flowinfo, 16 bytes IPv6 addr, 4 bytes scope-id</td><td>x0016 x00000000 x0102030405060708090a0b0c0d0e0f x00000000</td></tr> |
|||
<tr><td>UNIX</td><td>variable length path name, 0 terminated</td><td>x2f746d702f736f636b00</td></tr> |
|||
<tr><td>PACKET</td><td>2 bytes protocol (0x0003), interface index as int in host byte order, 8 bytes 0</td><td>x0003 x02000000 x0000000000000000</td></tr> |
|||
</table> |
|||
|
|||
<p>For AppleTalk see above <a href="#EXAMPLE_APPLETALK">example</a>.</p> |
|||
|
|||
<h4>Solaris on 32bit Intel:</h4> |
|||
|
|||
<table border=1> |
|||
<tr><th>name</th><th>socket address type (without leading address family)</th><th>binary specification</th></tr> |
|||
<tr><td>IPv6</td><td>2 bytes port, 4 bytes flowinfo, 16 bytes IPv6 addr, 4 |
|||
bytes scope-id, 4 bytes src-id</td><td>x0016 x00000000 x0102030405060708090a0b0c0d0e0f x00000000 x00000000</td></tr> |
|||
</table> |
|||
|
|||
<h3>Forever - play on...</h3> |
|||
|
|||
<p>Eager to experiment with exotic socket types? Run nmap's protocol scan and |
|||
see what is available on your system: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
nmap -sO localhost |
|||
</span></span> |
|||
|
|||
<p> |
|||
<small>Copyright: Gerhard Rieger 2008</small><br> |
|||
<small>License: <a href="http://www.fsf.org/licensing/licenses/fdl.html">GNU Free Documentation License (FDL)</a></small> |
|||
</p> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,392 @@ |
|||
<!-- source: doc/socat-multicast.html --> |
|||
<html><head> |
|||
<title>IP Multicasting with Socat</title> |
|||
<link rel="stylesheet" type="text/css" href="dest-unreach.css"> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<h1>IP Multicasting with Socat</h1> |
|||
|
|||
<h2>Introduction</h2> |
|||
<p> |
|||
Multicasting (and broadcasting which is also discussed in this article) |
|||
provides a means to direct a single packet to more than one host. Special |
|||
addresses are defined for this purpose and are handled specially by network |
|||
adapters, networking hardware, and IP stacks. |
|||
</p> |
|||
<p> |
|||
IPv4 specifications provide broadcasting and multicasting; IPv6 provides |
|||
multicasting but replaces broadcasting by special multicast modes. UNIX domain |
|||
sockets do not know broadcasting or multicasting. |
|||
</p> |
|||
<p> |
|||
The following examples use UDP/IPv4 only. However, they can easily be |
|||
adapted for raw IPv4 sockets. IPv6 multicasting has not yet been successfully |
|||
used with socat; please contact the author if you have positive experiences or |
|||
ideas that go beyond <tt>IPV6_ADD_MEMBERSHIP</tt>. |
|||
</p> |
|||
<p> |
|||
All multicast examples presented in this document use multicast address |
|||
224.1.0.1; it can be replaced by any valid IPv4 multicast address (except |
|||
<a href="#ALLSYSTEMS">all-systems</a>). |
|||
</p> |
|||
<p> |
|||
We assume a local network with address 192.168.10.0 and mask 255.255.255.0; an |
|||
eventual "client" has 192.168.10.1, example "server" and example peer have |
|||
192.168.10.2 in all examples. Change these addresses and mask to your own |
|||
requirements. |
|||
</p> |
|||
<p> |
|||
All the following examples work bidirectionally except when otherwise noticed. |
|||
For "clients" we just use <tt>STDIO</tt>, and for "servers" we use <tt>EXEC:hostname</tt> which |
|||
ingores its input but shows us which host the reply comes from. Replace these |
|||
socat addresses with what is appropriate for your needs (e.g. shell script |
|||
invocations). Port 6666 can be replaced with any other port (but for ports < |
|||
1024 root privilege might be required). |
|||
</p> |
|||
<p> |
|||
Different kinds of broadcast addresses exist: 255.255.255.255 is local network |
|||
only; for the IPv4 network 192.168.10.0/24 the "official" broadcast address |
|||
is 192.168.10.255; the network address 192.168.10.0 is also interpreted as |
|||
broadcast by some hosts. The two latter forms are routed by gateways. In the |
|||
following examples we only use broadcast address 192.168.10.255. |
|||
</p> |
|||
|
|||
<h2>Example 1: Multicast client and servers</h2> |
|||
|
|||
<p>This example builds something like a "supervisor" or "client" that |
|||
communicates with a set of "servers". The supervisor may send packets to the |
|||
multicast address, and the servers may send response packets. Note that the |
|||
servers would also respond to other clients' requests.</p> |
|||
|
|||
<p>Multicast server:</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat UDP4-RECVFROM:6666,ip-add-membership=224.1.0.1:192.168.10.2,fork EXEC:hostname |
|||
</span></span> |
|||
<p> |
|||
This command receives multicast packets addressed to 224.1.0.1 and forks a |
|||
child process for each. The child processes may each send one or more reply |
|||
packets back to the particular sender. 192.168.10.2 means the address of the |
|||
interface where multicasts should be received. |
|||
Run this command on a number of hosts, and they will all respond in |
|||
parallel.</p> |
|||
|
|||
<p>Multicast client:</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat STDIO UDP4-DATAGRAM:224.1.0.1:6666,range=192.168.10.0/24 |
|||
</span></span> |
|||
<p> |
|||
This process transfers data from stdin to the multicast address, and transfers |
|||
packets received from the local network to stdout. It does not matter in which |
|||
direction the first data is passed. |
|||
A packet from the network is accepted by the IP stack for our socket if: |
|||
<ul> |
|||
<li>it is an incoming UDP/IPv4 packet</li> |
|||
<li>its target port matches the local port assigned to the socket (random)</li> |
|||
<li>its target address matches one of the hosts local addresses or the any-host |
|||
multicast address</li> |
|||
</ul> |
|||
Of these packets, socat handles only those matching the following criteria: |
|||
<ul> |
|||
<li>the source address is within the given range</li> |
|||
<li>the source port is 6666</li> |
|||
</ul> |
|||
</p> |
|||
|
|||
|
|||
<h2>Example 2: Broadcast client and servers</h2> |
|||
|
|||
<p>Broadcast server:</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat UDP4-RECVFROM:6666,broadcast,fork EXEC:hostname |
|||
</span></span> |
|||
<p> |
|||
This command receives packets addressed to a local broadcast address and forks |
|||
a child process for each. The child processes may each send one or more reply |
|||
packets back to the particular sender. |
|||
Run this command on a number of hosts, and they will all respond in |
|||
parallel.</p> |
|||
|
|||
<p>Broadcast client:</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat STDIO UDP4-DATAGRAM:192.168.10.255:6666,broadcast,range=192.168.10.0/24 |
|||
</span></span> |
|||
<p> |
|||
This process transfers data from stdin to the broadcast address, and transfers |
|||
packets received from the local network to stdout. It does not matter in which |
|||
direction the first data is passed. |
|||
A packet from the network is accepted by the IP stack for our socket if: |
|||
<ul> |
|||
<li>it is an incoming UDP/IPv4 packet</li> |
|||
<li>its target port matches the local port assigned to the socket (6666)</li> |
|||
<li>its target address matches one of the hosts local addresses or the any-host |
|||
multicast address, or a local broadcast address</li> |
|||
</ul> |
|||
Of these packets, socat handles only those matching the following criteria: |
|||
<ul> |
|||
<li>the source address is within the given range</li> |
|||
<li>the source port is 6666</li> |
|||
</ul> |
|||
</p> |
|||
<p>The <tt>broadcast</tt> option is only required for sending or receiving |
|||
local broadcasts.</p> |
|||
|
|||
<h2>Example 3: Multicast peers</h2> |
|||
|
|||
<p>It is possible to combine multicast sender and receiver in one socat |
|||
address. This allows to start processes on different hosts on the local network |
|||
that will communicate symmetrically, so each process can send messages that are |
|||
received by all the other ones.</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat STDIO UDP4-DATAGRAM:224.1.0.1:6666,bind=:6666,range=192.168.10.0/24,ip-add-membership=224.1.0.1:192.168.10.2 |
|||
</span></span> |
|||
<p> |
|||
This command is valid for host 192.168.10.2; adapt this address to the |
|||
particular interface addresses of the hosts. |
|||
</p> |
|||
<p> |
|||
Starting this process opens a socket on port 6666 that will receive packets |
|||
directed to multicast address 224.1.0.1. Only packets with matching source |
|||
address and source port 6666 will be handled though. When this process sends |
|||
data to the network the packets will be addressed to 224.1.0.1:6666 and have a |
|||
source address of 192.168.10.2:6666, matching the accept criteria of the peers |
|||
on the local network. |
|||
</p> |
|||
|
|||
<p>Note: this command receives the packets it just has sent; add option |
|||
<tt>ip-multicast-loop=0</tt> if this in undesired.</p> |
|||
|
|||
<h2>Example 4: Broadcast peers</h2> |
|||
|
|||
<p>Just as with multicast, it is possible to combine broadcast sender and |
|||
receiver in one socat address.</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat STDIO UDP4-DATAGRAM:255.255.255.255:6666,bind=:6666,range=192.168.10.0/24,broadcast |
|||
</span></span> |
|||
<p> |
|||
Starting this process opens a socket on port 6666 that will receive packets |
|||
directed to a local broadcast addresses. Only packets with matching source |
|||
address and source port 6666 will be handled though. When this process sends |
|||
data to the network the packets will be addressed to 255.255.255.255:6666 and |
|||
have a source address of 192.168.10.2:6666, matching the accept criteria of |
|||
the peers on the local network. |
|||
</p> |
|||
|
|||
<p>Note: this command receives the packets it just has sent; there does not |
|||
seem to exist a simple way to prevent this.</p> |
|||
|
|||
|
|||
<h2>Troubleshooting</h2> |
|||
|
|||
<p> |
|||
If you do not get an error message during operation, but the packets do not |
|||
reach the target processes, use <tt>tcpdump</tt> to see if the packets have the |
|||
correct source and destination addresses and ports, and if they leave and enter |
|||
the hosts as expected. |
|||
</p> |
|||
<p> |
|||
The following subsections discuss some typical sources of trouble. |
|||
</p> |
|||
|
|||
<h3>IP filters</h3> |
|||
<p> |
|||
If you do not succeed in receiving multicast or broadcast packets, check if |
|||
iptables are activated on the receiving or sending host. They might be |
|||
configured to disallow this traffic. |
|||
</p> |
|||
|
|||
<h3>Do not bind()</h3> |
|||
<p> |
|||
When using multicast communications, you should not bind the sockets to a |
|||
specific IP address. It seems that the (Linux) IP stack compares the |
|||
destination address with the bind address, not taking care of the multicast |
|||
property of the incoming packet. |
|||
</p> |
|||
|
|||
<h3>Routing</h3> |
|||
<p> |
|||
When you receive an error like:</p> |
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>... E sendto(3, 0x80c2e44, 4, |
|||
0, AF=2 224.1.0.1:6666, 16): Network is unreachable</tt></td></tr></table> |
|||
<p>you have a routing problem. The (Linux) IP stack seems to handle multicast |
|||
addresses just like unicast addresses when determining their route (interface |
|||
and gateway), i.e. the routing table needs an entry that somehow matches the |
|||
target address. </p> |
|||
<p> |
|||
For the same reason, multicast packets will probably leave your host on the |
|||
interface with the default route if it is specified.</p> |
|||
<p> |
|||
Set a multicast/broadcast route with the following command (Linux):</p> |
|||
<span class="frame"><span class="shell"> |
|||
route add -net 224.0.0.0/3 gw 192.168.10.2 |
|||
</span></span> |
|||
|
|||
<a name="ALLSYSTEMS"></a> |
|||
<h3>ALL-SYSTEMS multicast address</h3> |
|||
<p> |
|||
<tt>224.0.0.1</tt> is the all-systems multicast address: all |
|||
datagram sockets appear to be automatically member of this group on all |
|||
interfaces. This membership cannot be dropped on Linux (you need iptables to |
|||
filter packets). |
|||
</p> |
|||
|
|||
|
|||
<h2>(In)Security</h2> |
|||
|
|||
<p>When you use the above examples you should understand that all datagram |
|||
sockets without exception accept all packets that are directly addressed to |
|||
them; |
|||
the multi- and broadcast receiving features are just extensions to this |
|||
functionality. socat currently has no means to handle incoming packets |
|||
differently whether they are addressed to unicast, multicast, or broadcast |
|||
addresses. However, for EXEC'd scripts socat can provide this info in |
|||
environment variables. |
|||
</p> |
|||
|
|||
<p>Authentication or encryption are not available.</p> |
|||
|
|||
<p>It is very easy to fake the source address of UDP (or raw IP) packets. You |
|||
should understand whether your network is protected from address spoofing |
|||
attacks.</p> |
|||
|
|||
<p>Broadcast and multicast traffic can trivially be received by <em>any</em> |
|||
host on the local network.</p> |
|||
|
|||
|
|||
<h2>History</h2> |
|||
|
|||
Starting with version 1.5.0, socat provides a set of address types that |
|||
allow various operations on datagram oriented sockets: |
|||
<dl> |
|||
<dt>SENDTO</dt><dd>send packets to a remote socket and receive packet from this |
|||
remote socket only</dd> |
|||
<dt>RECV</dt><dd>receive all packets that arrive on the local socket, but do |
|||
not reply</dd> |
|||
<dt>RECVFROM</dt><dd>receive all packets that arrive on the local socket, and |
|||
reply using child processes</dd> |
|||
</dl> |
|||
|
|||
<p> |
|||
These modes already enable several different client/server oriented operations. |
|||
Moreover, the SENDTO addresses can send to multicast and broadcast addresses |
|||
(the latter requires the <tt>broadcast</tt> option though). RECV and RECVFROM |
|||
also would accept packets addressed to a local broadcast address (with option |
|||
<tt>broadcast</tt>) or the all-systems multicast address. |
|||
</p> |
|||
|
|||
<p> |
|||
These address types had, however, two major caveats: |
|||
<ul> |
|||
<li>Missing control of multicast group membership in the RECV and RECVFROM |
|||
addresses</li> |
|||
<li>The SENDTO address would never accept a reply to a broadcast or multicast |
|||
addressed packet because the source address of incoming replies would not match |
|||
the target address of the sent packet. |
|||
</ul> |
|||
</p> |
|||
|
|||
<h3>New Features in socat 1.6.0</h3> |
|||
|
|||
<p> |
|||
socat version 1.6.0 addresses these problems and provides a new more generic |
|||
datagram address type (*-DATAGRAM) and the new address option IP-ADD-MEMBERSHIP. |
|||
</p> |
|||
|
|||
<p> |
|||
Please note that the new features could not be successfully tested on IPv6; |
|||
these sections thus apply to IPv4 only. |
|||
</p> |
|||
|
|||
<h3>New Features in socat 1.7.0</h3> |
|||
|
|||
<p> |
|||
socat version 1.7.0 helps to find more information about incoming packets in |
|||
environment variables that can be used in scripts or programs invoked by |
|||
socat. The option <tt>ip-pktinfo</tt> (on non-BSD systems) |
|||
or <tt>ip-recvdstaddr</tt> (on BSD systems) is required to get basic |
|||
information about incoming packets. |
|||
</p> |
|||
|
|||
<p> |
|||
Example: Start a receiver of the following form (tried on Linux): |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
socat -u UDP-RECVFROM:8888,reuseaddr,ip-add-membership=224.1.0.1:192.168.10.2,ip-pktinfo,fork SYSTEM:export |
|||
</span></span> |
|||
|
|||
<p> |
|||
Then send a multicast packet from the client: |
|||
</p> |
|||
|
|||
<span class="frame"><span class="shell"> |
|||
echo |socat -u STDIO UDP-DATAGRAM:224.1.0.1:8888 |
|||
</span></span> |
|||
|
|||
<p> |
|||
On the server the following text should appear (only interesting lines shown): |
|||
</p> |
|||
|
|||
<pre> |
|||
export SOCAT_IP_DSTADDR="224.1.0.1" |
|||
export SOCAT_IP_IF="eth0" |
|||
export SOCAT_IP_LOCADDR="192.168.10.2" |
|||
export SOCAT_PEERADDR="192.168.10.1" |
|||
export SOCAT_PEERPORT="41159" |
|||
</pre> |
|||
|
|||
<p> |
|||
<tt>SOCAT_IP_IF</tt> shows the interface where the packet entered the server; |
|||
<tt>SOCAT_IP_LOCADDR</tt> shows the IP address of this interface; |
|||
<tt>SOCAT_IP_DSTADDR</tt> shows the target address of the packet; |
|||
<tt>SOCAT_PEERADDR</tt> and <tt>SOCAT_PEERPORT</tt> are the client socket |
|||
values. |
|||
</p> |
|||
|
|||
<h2>More info about socat datagrams</h2> |
|||
|
|||
<h3>Links regarding this tutorial</h3> |
|||
<a href="socat.html#ADDRESS_UDP4_DATAGRAM">address UDP4-DATAGRAM</a><br> |
|||
<a href="socat.html#ADDRESS_UDP4_RECVFROM">address UDP4-RECVFROM</a><br> |
|||
<a href="socat.html#OPTION_RANGE">option range</a><br> |
|||
<a href="socat.html#OPTION_SO_BROADCAST">option broadcast</a><br> |
|||
<a href="socat.html#OPTION_IP_ADD_MEMBERSHIP">option ip-add-membership</a><br> |
|||
<a href="socat.html#OPTION_FORK">option fork</a><br> |
|||
<a href="socat.html#OPTION_BIND">option bind</a><br> |
|||
|
|||
<h3>Other datagram addresses</h3> |
|||
<a href="socat.html#ADDRESS_UDP4_RECV">address UDP4-RECV</a>: pure datagram receiver<br> |
|||
<a href="socat.html#ADDRESS_UDP4_SENDTO">address UDP4-SENDTO</a>: communicate |
|||
with one peer address<br> |
|||
<a href="socat.html#ADDRESS_UDP4_LISTEN">address UDP4-LISTEN</a>: pseudo stream server<br> |
|||
<a href="socat.html#ADDRESS_UDP4_CONNECT">address UDP4-CONNECT</a>: pseudo stream client<br> |
|||
|
|||
<h3>Related socat option groups</h3> |
|||
<a href="socat.html#GROUP_IP">IP options</a><br> |
|||
<a href="socat.html#GROUP_SOCKET">socket options</a><br> |
|||
<a href="socat.html#GROUP_FD">file descriptor options</a><br> |
|||
<a href="socat.html#GROUP_RANGE">range options</a><br> |
|||
<a href="socat.html#GROUP_CHILD">child process options</a><br> |
|||
|
|||
|
|||
<h2>References</h2> |
|||
<a href="http://www.dest-unreach.org/socat">socat home page</a><br> |
|||
<a href="socat.html">socat man page</a><br> |
|||
<a href="http://en.wikipedia.org/wiki/Multicast">multicasting on Wikipedia</a><br> |
|||
<a href="http://en.wikipedia.org/wiki/Broadcast_address">broadcasting on Wikipedia</a><br> |
|||
|
|||
<p> |
|||
<small>This document was last modified in May 2009.</small><br> |
|||
<small>Copyright: Gerhard Rieger 2007-2009</small><br> |
|||
<small>License: <a href="http://www.fsf.org/licensing/licenses/fdl.html">GNU Free Documentation License (FDL)</a></small> |
|||
</p> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,192 @@ |
|||
<!-- $Revision: 1.1 $ $Date: 2007/03/06 20:54:43 $ --> |
|||
<html><head> |
|||
<title>Securing Traffic Between two Socat Instances Using SSL</title> |
|||
<link rel="stylesheet" type="text/css" href="dest-unreach.css"> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<h1>Securing Traffic Between two Socat Instances Using SSL</h1> |
|||
|
|||
<h2>Introduction</h2> |
|||
<p> |
|||
When you want to connect two socat processes running on different machines and |
|||
feel that you need to protect the connection against unauthorized access, |
|||
sniffing, data manipulation etc., you might want to encrypt the communications. |
|||
</p> |
|||
<p> |
|||
For this purpose socat integrates the OpenSSL library and provides SSL client |
|||
and server features. |
|||
</p> |
|||
<p> |
|||
SSL is a complex protocol that provides much more features than required for |
|||
protecting a single connection; in this document we present only a simple |
|||
scenario that provides just the basic security requirements. |
|||
</p> |
|||
|
|||
<!-- discussion --> |
|||
<h2>Configuring OpenSSL in socat</h2> |
|||
<p> |
|||
This section shows how the SSL addresses can be configured in socat. |
|||
In this docu we only use self signed certificates for the sake of simplicity. |
|||
</p> |
|||
<p>We assume that the server host is called <tt>server.domain.org</tt> and the |
|||
server process uses port 4433. To keep it simple, we use a very simple server |
|||
funtionality that just echos data (<tt>echo</tt>), and <tt>stdio</tt> on the |
|||
client.</p> |
|||
<h3>Generate a server certificate</h3> |
|||
|
|||
<p>Perform the following steps on a trusted host where OpenSSL is |
|||
installed. It might as well be the client or server host themselves.</p> |
|||
<p>Prepare a basename for the files related to the server certificate:</p> |
|||
<span class="frame"><span class="shell">FILENAME=server</span></span> |
|||
|
|||
<p>Generate a public/private key pair:</p> |
|||
<span class="frame"><span class="shell">openssl genrsa -out $FILENAME.key 1024</span></span> |
|||
|
|||
<p>Generate a self signed certificate:</p> |
|||
<span class="frame"><span class="shell"> |
|||
openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt</span></span> |
|||
<p>You will be prompted for your country code, name etc.; you may quit all prompts |
|||
with the enter key.</p> |
|||
<p>Generate the PEM file by just appending the key and certificate files:<p> |
|||
<span class="frame"><span class="shell">cat $FILENAME.key $FILENAME.crt >$FILENAME.pem</span></span> |
|||
|
|||
<p>The files that contain the private key should be kept secret, thus adapt |
|||
their permissions:<p> |
|||
<span class="frame"><span class="shell">chmod 600 $FILENAME.key $FILENAME.pem</span></span> |
|||
|
|||
<p>Now bring the file <tt>server.pem</tt> to the SSL server, e.g. to directory |
|||
<tt>$HOME/etc/</tt>, using a secure channel like USB memory stick or SSH. Keep |
|||
tight permissions on the file even on the target host, and remove all other |
|||
instances of <tt>server.key</tt> and <tt>server.pem</tt>. |
|||
</p> |
|||
<p>Copy the trust certificate server.crt to the SSL client host, e.g. to directory |
|||
<tt>$HOME/etc/</tt>; a secure channel is not required here, and the permissions |
|||
are not critical. |
|||
</p> |
|||
|
|||
<h3>Generate a client certificate</h3> |
|||
<p>First prepare a different basename for the files related to the client certificate:</p> |
|||
<span class="frame"><span class="shell">FILENAME=client</span></span> |
|||
|
|||
<p>Repeat the procedure for certificate generation described above. |
|||
Copy <tt>client.pem</tt> to the SSL client, and <tt>client.crt</tt> to the |
|||
server.</p> |
|||
|
|||
<h3>OpenSSL Server</h3> |
|||
|
|||
<p>Instead of using a tcp-listen (tcp-l) address, we use openssl-listen (ssl-l) |
|||
for the server, <tt>cert=...</tt> tells the program to the file containing its |
|||
ceritificate and private key, and <tt>cafile=...</tt> points to the file |
|||
containing the certificate of the peer; we trust clients only if they can proof |
|||
that they have the related private key (OpenSSL handles this for us):<p> |
|||
<span class="frame"><span class="shell">socat openssl-listen:4433,reuseaddr,cert=$HOME/etc/server.pem,cafile=$HOME/etc/client.crt echo</span></span> |
|||
<p>After starting this command, socat should be listening on port 4433, but |
|||
will require client authentication.</p> |
|||
|
|||
<h3>OpenSSL Client</h3> |
|||
<p>Substitute your <tt>tcp-connect</tt> or <tt>tcp</tt> address keyword with |
|||
<tt>openssl-connect</tt> or just <tt>ssl</tt> and here too add the |
|||
<tt>cert</tt> and <tt>cafile</tt> options:<p> |
|||
<span class="frame"><span class="shell">socat stdio openssl-connect:server.domain.org:4433,cert=$HOME/etc/client.pem,cafile=$HOME/etc/server.crt</span></span> |
|||
<p>This command should establish a secured connection to the server |
|||
process.</p> |
|||
|
|||
<h3>TCP/IP version 6</h3> |
|||
|
|||
<p>If the communication is to go over IPv6, the above described commands have |
|||
to be adapted; <tt>ip6name.domain.org</tt> is assumed to resolve to the IPv6 |
|||
address of the server:</p> |
|||
<p>Server:</p> |
|||
<span class="frame"><span class="shell">socat |
|||
openssl-listen:4433,<b style="color:yellow">pf=ip6</b>,reuseaddr,cert=$HOME/etc/server.pem,cafile=$HOME/etc/client.crt echo</span></span> |
|||
|
|||
<p>Client:</p> |
|||
<span class="frame"><span class="shell">socat stdio openssl-connect:<b style="color:yellow">ip6name</b>.domain.org:4433,cert=$HOME/etc/client.pem,cafile=$HOME/etc/server.crt</span></span> |
|||
|
|||
<h2>Troubleshooting</h2> |
|||
|
|||
<h3>Test OpenSSL Integration</h3> |
|||
<p> |
|||
If you get error messages like this:</p> |
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>... E unknown device/address "openssl-listen"</tt></td></tr></table> |
|||
<p>your socat executable probably does not have the OpenSSL library linked in. |
|||
Check socat's compile time configuration with the following command:</p> |
|||
<span class="frame"><span class="shell">socat -V |grep SSL</span></span> |
|||
<p>Positive output: |
|||
<tt>#define WITH_OPENSSL 1</tt><br> |
|||
Negative output: |
|||
<tt>#undef WITH_OPENSSL</tt><br> |
|||
</p> |
|||
<p> |
|||
In the latter case, make sure you have OpenSSL and its development package |
|||
(include files) installed, and check the run of the configure script. |
|||
</p> |
|||
|
|||
|
|||
<h2>History</h2> |
|||
<p> |
|||
A first OpenSSL client was implemented in socat 1.2.0; it did not support |
|||
client certificates and could not verify server certificates. It was rather |
|||
considered as a tool for probing typical SSL secured Internet services. |
|||
</p> |
|||
<p> |
|||
From version 1.4.0 on, socat provided experimental support for SSL client and |
|||
SSL server, implemented using the OpenSSL libraries. Only TCP/IPv4 transport |
|||
was supported. With both SSL client and server, trust certificates for checking |
|||
the peers authentication, and certificates for authentication could be |
|||
specified. This allowed for non interactive secure connection establishing. |
|||
The features were considered experimental; like most Internet sites, socat |
|||
server did not require the client to present a certificate per default, but the |
|||
client required a server certificate. |
|||
|
|||
</p> |
|||
<p> |
|||
DSA certificate support is implemented since version 1.4.2. |
|||
</p> |
|||
<p> |
|||
Socat version 1.5.0 extended SSL to TCP/IPv6 transports. |
|||
</p> |
|||
<p> |
|||
With socat version 1.6.0, the SSL server per default requires the client to |
|||
present a trusted certificate. socat's OpenSSL implementation still does not |
|||
check the contents of a certificate like host name or host address. |
|||
</p> |
|||
|
|||
<p>This document was last modified in March 2007.</p> |
|||
|
|||
<h2>More info about socat OpenSSL</h2> |
|||
|
|||
<h3>Links regarding this tutorial</h3> |
|||
<a href="socat.html#ADDRESS_OPENSSL_CONNECT">address openssl-connect</a><br> |
|||
<a href="socat.html#ADDRESS_OPENSSL_LISTEN">address openssl-listen</a><br> |
|||
<a href="socat.html#OPTION_OPENSSL_CERTIFICATE">option cert</a><br> |
|||
<a href="socat.html#OPTION_OPENSSL_CAFILE">option cafile</a><br> |
|||
|
|||
<h3>More socat options for OpenSSL addresses</h3> |
|||
<a href="socat.html#GROUP_OPENSSL">OpenSSL options</a><br> |
|||
<a href="socat.html#GROUP_TCP">TCP options</a><br> |
|||
<a href="socat.html#GROUP_IP">IP options</a><br> |
|||
<a href="socat.html#GROUP_SOCKET">socket options</a><br> |
|||
<a href="socat.html#GROUP_FD">file descriptor options</a><br> |
|||
<a href="socat.html#GROUP_RETRY">retry options</a><br> |
|||
<p>For openssl-listen only:</p> |
|||
<a href="socat.html#GROUP_LISTEN">listen options</a><br> |
|||
<a href="socat.html#GROUP_CHILD">child options</a><br> |
|||
<a href="socat.html#GROUP_RANGE">range options</a><br> |
|||
|
|||
<h2>References</h2> |
|||
<a href="http://www.dest-unreach.org/socat">socat home page</a><br> |
|||
<a href="socat.html">socat man page</a><br> |
|||
<a href="http://www.openssl.org/">OpenSSL home page</a><br> |
|||
<a href="http://www.stunnel.org/">stunnel home page</a><br> |
|||
<a href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer">secure sockets layer on Wikipedia</a><br> |
|||
|
|||
<p> |
|||
<small>Copyright: Gerhard Rieger 2007</small><br> |
|||
<small>License: <a href="http://www.fsf.org/licensing/licenses/fdl.html">GNU Free Documentation License (FDL)</a></small> |
|||
</p> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,169 @@ |
|||
<!-- source: doc/socat-tun.html --> |
|||
<html><head> |
|||
<title>Building TUN based virtual networks with socat</title> |
|||
<link rel="stylesheet" type="text/css" href="dest-unreach.css"> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<h1>Building TUN based virtual networks with socat</h1> |
|||
|
|||
<h2>Introduction</h2> |
|||
<p> |
|||
Some operating systems allow the generation of virtual network interfaces that |
|||
do not connect to a wire but to a process that simulates the network. Often |
|||
these devices are called TUN or TAP. |
|||
</p> |
|||
<p> |
|||
socat provides an address type that creates a TUN device on Linux; the other |
|||
socat address can be any type; it transfers the "wire" data as desired. |
|||
</p> |
|||
<p> |
|||
This document shows how a simple virtual network can be created between |
|||
two hosts that may be far (many network hops) apart. On both hosts a socat |
|||
instance is started that connects to the other host using TCP and creates a TUN |
|||
device. See <a href="socat-openssltunnel.html">socat-openssltunnel.html</a> for |
|||
a guide on securing the connection using SSL. |
|||
</p> |
|||
<p> |
|||
The following IP addresses are used in the example; replace them in the |
|||
following commands with the requirements of your situation:</p> |
|||
<table border="1"> |
|||
<tr><th>host</th><th>address</th><th>mask</th></tr> |
|||
<tr><td>physical "server" address</td><td>1.2.3.4</td><td>n/a</td></tr> |
|||
<tr><td>physical "client" address</td><td>n/a</td><td>n/a</td></tr> |
|||
<tr><td>TUN on "server"</td><td>192.168.255.1</td><td>255.255.255.0</td></tr> |
|||
<tr><td>TUN on "client"</td><td>192.168.255.2</td><td>255.255.255.0</td></tr> |
|||
</table> |
|||
<p>The TCP connection uses port 11443.</p> |
|||
|
|||
<p>On "default" Linux installations, creating TUN/TAP devices might require |
|||
root privilege.</p> |
|||
|
|||
<!-- discussion --> |
|||
<h2>Generate TUN devices with socat</h2> |
|||
<p>In this section two instances of socat are used to generate TUN devices on |
|||
different hosts and connect the "wire" sides, providing a simple virtual |
|||
network. |
|||
</p> |
|||
<p> |
|||
We distinguish server and client only with respect to the connection between |
|||
the two socat instances; the TUN interfaces both have the same quality. |
|||
</p> |
|||
|
|||
<h3>TUN Server</h3> |
|||
|
|||
<span class="frame"><span class="shell">socat -d -d TCP-LISTEN:11443,reuseaddr TUN:192.168.255.1/24,up</span></span> |
|||
<p>After starting this command, socat will wait for a connection and then |
|||
create a TUN pseudo network device with address 192.168.255.1; the bit number |
|||
specifies the mask of the network that is pretended to be connected on this |
|||
interface.</p> |
|||
|
|||
<h3>TUN Client</h3> |
|||
<span class="frame"><span class="shell">socat TCP:1.2.3.4:11443 TUN:192.168.255.2/24,up</span></span> |
|||
<p>This command should establish a connection to the server and create the TUN |
|||
device on the client.</p> |
|||
|
|||
<h3>Seeing it work</h3> |
|||
|
|||
<p> |
|||
After successful connection both TUN interfaces should be active and transfer |
|||
date between each other using the TCP connection. Try this by pinging |
|||
192.168.255.1 from the client and 192.168.255.2 from the server. |
|||
</p> |
|||
|
|||
<h3>TCP/IP version 6</h3> |
|||
|
|||
<p>IPv6 as transport should work just like any TCP/IPv6 connection.</p> |
|||
|
|||
<p>Creation of an IPv6 virtual interface is not directly possible, but you can |
|||
generate an IPv4 interface as described above, and add IPv6 addresses using |
|||
the <tt>ifconfig</tt> command. |
|||
|
|||
<h2>Troubleshooting</h2> |
|||
|
|||
<h3>Test TUN integration</h3> |
|||
<p> |
|||
If you get error messages like this:</p> |
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>... E unknown device/address "tun"</tt></td></tr></table> |
|||
<p>your socat executable probably does not provide TUN/TAP support. Potential |
|||
reasons: you are not on Linux or are using an older version of socat. |
|||
</p> |
|||
|
|||
<h3>Missing kernel support</h3> |
|||
<p>An error message like:</p> |
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>... E open("/dev/net/tun", 02, 0666): No such file or directory</tt></td></tr></table> |
|||
<p>indicates that your kernel either needs to load the tun module or does not |
|||
have TUN/TAP support compiled in. Try to load the module:</p> |
|||
<span class="frame"><span class="shell">modprobe tun</span></span> |
|||
<p>and check |
|||
for /dev/net/tun. If that does not succeed you need to |
|||
rebuild your kernel with the appropriate configuration (probably under |
|||
<b>Device driver / Network device support / Network device / Universal TUN/TAP</b>). |
|||
</p> |
|||
|
|||
<h3>TUN cloning device permissions</h3> |
|||
<p>An error message like:</p> |
|||
<table border="1" bgcolor="#e08080"><tr><td><tt>... E open("/dev/net/tun", 02, 0666): Permission denied</tt></td></tr></table> |
|||
<p>indicates that you do not have permission to read or write the TUN cloning |
|||
device. Check its permission and ownership.</p> |
|||
|
|||
<h3>Interface down</h3> |
|||
<p>If no error occurs but the pings do not work check if the network devices |
|||
have been created:</p> |
|||
<span class="frame"><span class="shell">ifconfig tun0</span></span> |
|||
<p>The output should look like:</p> |
|||
<pre> |
|||
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 |
|||
inet addr:192.168.255.1 P-t-P:192.168.255.1 Mask:255.255.255.0 |
|||
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 |
|||
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 |
|||
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 |
|||
collisions:0 txqueuelen:500 |
|||
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
|||
</pre> |
|||
<p>Check the "UP" keyword; you forget the "up" option in the socat command if |
|||
it is missing.<p> |
|||
<p>Check if the correct IP address and network mask are displayed.</p> |
|||
|
|||
<h3>Routing</h3> |
|||
<p></p> |
|||
<span class="frame"><span class="shell">netstat -an |fgrep 192.168.255</span></span> |
|||
<p>The output should look like:</p> |
|||
<pre> |
|||
192.168.255.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0 |
|||
</pre> |
|||
|
|||
<h3>Other problems</h3> |
|||
<p>Another reason for failure might be iptables.</p> |
|||
<p>Run socat with options <tt>-d -d -d</tt>, this will show every data transfer |
|||
between the two processes. Each ping probe should cause a forth and a back |
|||
transfer.<p> |
|||
|
|||
<h2>History</h2> |
|||
<p> |
|||
Linux TUN/TAP support was added to socat in version 1.6.0.</p> |
|||
|
|||
<p>This document was last modified in February 2010.</p> |
|||
|
|||
<h2>More info about socat TUN/TAP support</h2> |
|||
|
|||
<h3>Links regarding this tutorial</h3> |
|||
<a href="socat.html#ADDRESS_TUN">socat address tun</a><br> |
|||
|
|||
<h3>socat options for TUN/TAP addresses</h3> |
|||
<a href="socat.html#GROUP_TUN">TUN/TAP options</a><br> |
|||
|
|||
<h2>References</h2> |
|||
<a href="http://www.dest-unreach.org/socat">socat home page</a><br> |
|||
<a href="socat.html">socat man page</a><br> |
|||
<a href="http://openvpn.net/">OpenVPN home page</a><br> |
|||
<a href="http://en.wikipedia.org/wiki/TUN/TAP">TUN/TAP on Wikipedia</a><br> |
|||
|
|||
<p> |
|||
<small>Copyright: Gerhard Rieger 2007-2010</small><br> |
|||
<small>License: <a href="http://www.fsf.org/licensing/licenses/fdl.html">GNU Free Documentation License (FDL)</a></small> |
|||
</p> |
|||
|
|||
</body> |
|||
</html> |
|||
3748
lib/hardware/socat-1.7.3.4/doc/socat.1
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3627
lib/hardware/socat-1.7.3.4/doc/socat.html
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3562
lib/hardware/socat-1.7.3.4/doc/socat.yo
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
4976
lib/hardware/socat-1.7.3.4/doc/xio.help
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,488 @@ |
|||
/* source: error.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* the logging subsystem */ |
|||
|
|||
#include "config.h" |
|||
#include "sysincludes.h" |
|||
|
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "utils.h" |
|||
#include "vsnprintf_r.h" |
|||
#include "snprinterr.h" |
|||
|
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
|
|||
|
|||
/* translate MSG level to SYSLOG level */ |
|||
int syslevel[] = { |
|||
LOG_DEBUG, |
|||
LOG_INFO, |
|||
LOG_NOTICE, |
|||
LOG_WARNING, |
|||
LOG_ERR, |
|||
LOG_CRIT }; |
|||
|
|||
struct diag_opts { |
|||
const char *progname; |
|||
int msglevel; |
|||
int exitlevel; |
|||
int syslog; |
|||
FILE *logfile; |
|||
int logfacility; |
|||
bool micros; |
|||
int exitstatus; /* pass signal number to error exit */ |
|||
bool withhostname; /* in custom logs add hostname */ |
|||
char *hostname; |
|||
} ; |
|||
|
|||
|
|||
static void _diag_exit(int status); |
|||
|
|||
|
|||
struct diag_opts diagopts = |
|||
{ NULL, E_ERROR, E_ERROR, 0, NULL, LOG_DAEMON, false, 0 } ; |
|||
|
|||
static void msg2( |
|||
#if HAVE_CLOCK_GETTIME |
|||
struct timespec *now, |
|||
#elif HAVE_GETTIMEOFDAY |
|||
struct timeval *now, |
|||
#else |
|||
time_t *now, |
|||
#endif |
|||
int level, int exitcode, int handler, const char *text); |
|||
static void _msg(int level, const char *buff, const char *syslp); |
|||
|
|||
sig_atomic_t diag_in_handler; /* !=0 indicates to msg() that in signal handler */ |
|||
sig_atomic_t diag_immediate_msg; /* !=0 prints messages even from within signal handler instead of deferring them */ |
|||
sig_atomic_t diag_immediate_exit; /* !=0 calls exit() from diag_exit() even when in signal handler. For system() */ |
|||
|
|||
static struct wordent facilitynames[] = { |
|||
{"auth", (void *)LOG_AUTH}, |
|||
#ifdef LOG_AUTHPRIV |
|||
{"authpriv", (void *)LOG_AUTHPRIV}, |
|||
#endif |
|||
#ifdef LOG_CONSOLE |
|||
{"console", (void *)LOG_CONSOLE}, |
|||
#endif |
|||
{"cron", (void *)LOG_CRON}, |
|||
{"daemon", (void *)LOG_DAEMON}, |
|||
#ifdef LOG_FTP |
|||
{"ftp", (void *)LOG_FTP}, |
|||
#endif |
|||
{"kern", (void *)LOG_KERN}, |
|||
{"local0", (void *)LOG_LOCAL0}, |
|||
{"local1", (void *)LOG_LOCAL1}, |
|||
{"local2", (void *)LOG_LOCAL2}, |
|||
{"local3", (void *)LOG_LOCAL3}, |
|||
{"local4", (void *)LOG_LOCAL4}, |
|||
{"local5", (void *)LOG_LOCAL5}, |
|||
{"local6", (void *)LOG_LOCAL6}, |
|||
{"local7", (void *)LOG_LOCAL7}, |
|||
{"lpr", (void *)LOG_LPR}, |
|||
{"mail", (void *)LOG_MAIL}, |
|||
{"news", (void *)LOG_NEWS}, |
|||
#ifdef LOG_SECURITY |
|||
{"security", (void *)LOG_SECURITY}, |
|||
#endif |
|||
{"syslog", (void *)LOG_SYSLOG}, |
|||
{"user", (void *)LOG_USER}, |
|||
{"uucp", (void *)LOG_UUCP} |
|||
} ; |
|||
|
|||
/* serialize message for sending from signal handlers */ |
|||
struct sermsg { |
|||
int severity; |
|||
#if HAVE_CLOCK_GETTIME |
|||
struct timespec ts; |
|||
#else |
|||
struct timeval tv; |
|||
#endif |
|||
} ; |
|||
|
|||
static int diaginitialized; |
|||
static int diag_sock_send = -1; |
|||
static int diag_sock_recv = -1; |
|||
static int diag_msg_avail = 0; /* !=0: messages from within signal handler may be waiting */ |
|||
|
|||
|
|||
static int diag_sock_pair(void) { |
|||
int handlersocks[2]; |
|||
|
|||
if (socketpair(AF_UNIX, SOCK_DGRAM, 0, handlersocks) < 0) { |
|||
diag_sock_send = -1; |
|||
diag_sock_recv = -1; |
|||
return -1; |
|||
} |
|||
diag_sock_send = handlersocks[1]; |
|||
diag_sock_recv = handlersocks[0]; |
|||
return 0; |
|||
} |
|||
|
|||
static int diag_init(void) { |
|||
if (diaginitialized) { |
|||
return 0; |
|||
} |
|||
diaginitialized = 1; |
|||
/* gcc with GNU libc refuses to set this in the initializer */ |
|||
diagopts.logfile = stderr; |
|||
if (diag_sock_pair() < 0) { |
|||
return -1; |
|||
} |
|||
return 0; |
|||
} |
|||
#define DIAG_INIT ((void)(diaginitialized || diag_init())) |
|||
|
|||
|
|||
void diag_set(char what, const char *arg) { |
|||
DIAG_INIT; |
|||
switch (what) { |
|||
const struct wordent *keywd; |
|||
|
|||
case 'y': diagopts.syslog = true; |
|||
if (arg && arg[0]) { |
|||
if ((keywd = |
|||
keyw(facilitynames, arg, |
|||
sizeof(facilitynames)/sizeof(struct wordent))) == NULL) { |
|||
Error1("unknown syslog facility \"%s\"", arg); |
|||
} else { |
|||
diagopts.logfacility = (int)(size_t)keywd->desc; |
|||
} |
|||
} |
|||
openlog(diagopts.progname, LOG_PID, diagopts.logfacility); |
|||
if (diagopts.logfile != NULL && diagopts.logfile != stderr) { |
|||
fclose(diagopts.logfile); |
|||
} |
|||
diagopts.logfile = NULL; |
|||
break; |
|||
case 'f': |
|||
if (diagopts.logfile != NULL && diagopts.logfile != stderr) { |
|||
fclose(diagopts.logfile); |
|||
} |
|||
if ((diagopts.logfile = fopen(arg, "a")) == NULL) { |
|||
Error2("cannot open log file \"%s\": %s", arg, strerror(errno)); |
|||
} |
|||
break; |
|||
case 's': |
|||
if (diagopts.logfile != NULL && diagopts.logfile != stderr) { |
|||
fclose(diagopts.logfile); |
|||
} |
|||
diagopts.logfile = stderr; break; /* logging to stderr is default */ |
|||
case 'p': diagopts.progname = arg; |
|||
openlog(diagopts.progname, LOG_PID, diagopts.logfacility); |
|||
break; |
|||
case 'd': --diagopts.msglevel; break; |
|||
case 'u': diagopts.micros = true; break; |
|||
default: msg(E_ERROR, "unknown diagnostic option %c", what); |
|||
} |
|||
} |
|||
|
|||
void diag_set_int(char what, int arg) { |
|||
DIAG_INIT; |
|||
switch (what) { |
|||
case 'D': diagopts.msglevel = arg; break; |
|||
case 'e': diagopts.exitlevel = arg; break; |
|||
case 'x': diagopts.exitstatus = arg; break; |
|||
case 'h': diagopts.withhostname = arg; |
|||
if ((diagopts.hostname = getenv("HOSTNAME")) == NULL) { |
|||
struct utsname ubuf; |
|||
uname(&ubuf); |
|||
diagopts.hostname = strdup(ubuf.nodename); |
|||
} |
|||
break; |
|||
default: msg(E_ERROR, "unknown diagnostic option %c", what); |
|||
} |
|||
} |
|||
|
|||
int diag_get_int(char what) { |
|||
DIAG_INIT; |
|||
switch (what) { |
|||
case 'y': return diagopts.syslog; |
|||
case 's': return diagopts.logfile == stderr; |
|||
case 'd': case 'D': return diagopts.msglevel; |
|||
case 'e': return diagopts.exitlevel; |
|||
} |
|||
return -1; |
|||
} |
|||
|
|||
const char *diag_get_string(char what) { |
|||
DIAG_INIT; |
|||
switch (what) { |
|||
case 'p': return diagopts.progname; |
|||
} |
|||
return NULL; |
|||
} |
|||
|
|||
/* make sure that the diag_sock fds do not have this num */ |
|||
int diag_reserve_fd(int fd) { |
|||
DIAG_INIT; |
|||
if (diag_sock_send == fd) { |
|||
diag_sock_send = Dup(fd); |
|||
Close(fd); |
|||
} |
|||
if (diag_sock_recv == fd) { |
|||
diag_sock_recv = Dup(fd); |
|||
Close(fd); |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
/* call this after a fork() from the child process to separate master/parent |
|||
sockets from child sockets */ |
|||
int diag_fork() { |
|||
Close(diag_sock_send); |
|||
Close(diag_sock_recv); |
|||
return diag_sock_pair(); |
|||
} |
|||
|
|||
/* Linux and AIX syslog format: |
|||
Oct 4 17:10:37 hostname socat[52798]: D signal(13, 1) |
|||
*/ |
|||
void msg(int level, const char *format, ...) { |
|||
struct diag_dgram diag_dgram; |
|||
va_list ap; |
|||
|
|||
/* does not perform a system call if nothing todo, thanks diag_msg_avail */ |
|||
|
|||
diag_dgram._errno = errno; /* keep for passing from signal handler to sock. |
|||
reason is that strerror is definitely not |
|||
async-signal-safe */ |
|||
DIAG_INIT; |
|||
|
|||
/* in normal program flow (not in signal handler) */ |
|||
/* first flush the queue of datagrams from the socket */ |
|||
if (diag_msg_avail && !diag_in_handler) { |
|||
diag_msg_avail = 0; /* _before_ flush to prevent inconsistent state when signal occurs inbetween */ |
|||
diag_flush(); |
|||
} |
|||
|
|||
if (level < diagopts.msglevel) { return; } |
|||
va_start(ap, format); |
|||
|
|||
/* we do only a minimum in the outer parts which may run in a signal handler |
|||
these are: get actual time, level, serialized message and write them to socket |
|||
*/ |
|||
diag_dgram.op = DIAG_OP_MSG; |
|||
#if HAVE_CLOCK_GETTIME |
|||
clock_gettime(CLOCK_REALTIME, &diag_dgram.now); |
|||
#elif HAVE_GETTIMEOFDAY |
|||
gettimeofday(&diag_dgram.now, NULL); |
|||
#else |
|||
diag_dgram.now = time(NULL); |
|||
#endif |
|||
diag_dgram.level = level; |
|||
diag_dgram.exitcode = diagopts.exitstatus; |
|||
vsnprintf_r(diag_dgram.text, sizeof(diag_dgram.text), format, ap); |
|||
if (diag_in_handler && !diag_immediate_msg) { |
|||
send(diag_sock_send, &diag_dgram, sizeof(diag_dgram)-TEXTLEN + strlen(diag_dgram.text)+1, MSG_DONTWAIT |
|||
#ifdef MSG_NOSIGNAL |
|||
|MSG_NOSIGNAL |
|||
#endif |
|||
); |
|||
diag_msg_avail = 1; |
|||
va_end(ap); |
|||
return; |
|||
} |
|||
|
|||
msg2(&diag_dgram.now, diag_dgram.level, diagopts.exitstatus, 0, diag_dgram.text); |
|||
va_end(ap); return; |
|||
} |
|||
|
|||
void msg2( |
|||
#if HAVE_CLOCK_GETTIME |
|||
struct timespec *now, |
|||
#elif HAVE_GETTIMEOFDAY |
|||
struct timeval *now, |
|||
#else |
|||
time_t *now, |
|||
#endif |
|||
int level, /* E_INFO... */ |
|||
int exitcode, /* on exit use this exit code */ |
|||
int handler, /* message comes from signal handler */ |
|||
const char *text) { |
|||
time_t epoch; |
|||
unsigned long micros; |
|||
#if HAVE_STRFTIME |
|||
struct tm struct_tm; |
|||
#endif |
|||
#define BUFLEN 512 |
|||
char buff[BUFLEN], *bufp, *syslp; |
|||
size_t bytes; |
|||
|
|||
#if HAVE_CLOCK_GETTIME |
|||
epoch = now->tv_sec; |
|||
#elif HAVE_GETTIMEOFDAY |
|||
epoch = now->tv_sec; |
|||
#else |
|||
epoch = *now; |
|||
#endif |
|||
#if HAVE_STRFTIME |
|||
bytes = strftime(buff, 20, "%Y/%m/%d %H:%M:%S", localtime_r(&epoch, &struct_tm)); |
|||
buff[bytes] = '\0'; |
|||
#else |
|||
bytes = snprintf(buff, 11, F_time, epoch); |
|||
#endif |
|||
if (diagopts.micros) { |
|||
#if HAVE_CLOCK_GETTIME |
|||
micros = now->tv_nsec/1000; |
|||
#elif HAVE_GETTIMEOFDAY |
|||
micros = now->tv_usec; |
|||
#else |
|||
micros = 0; |
|||
#endif |
|||
bytes += sprintf(buff+19, ".%06lu ", micros); |
|||
} else { |
|||
buff[19] = ' '; buff[20] = '\0'; |
|||
} |
|||
bytes = strlen(buff); |
|||
|
|||
bufp = buff + bytes; |
|||
if (diagopts.withhostname) { |
|||
bytes = sprintf(bufp, "%s ", diagopts.hostname), bufp+=bytes; |
|||
} |
|||
bytes = sprintf(bufp, "%s["F_pid"] ", diagopts.progname, getpid()); |
|||
bufp += bytes; |
|||
syslp = bufp; |
|||
*bufp++ = "DINWEF"[level]; |
|||
#if 0 /* only for debugging socat */ |
|||
if (handler) bufp[-1] = tolower(bufp[-1]); /* for debugging, low chars indicate messages from signal handlers */ |
|||
#endif |
|||
*bufp++ = ' '; |
|||
strncpy(bufp, text, BUFLEN-(bufp-buff)-1); |
|||
strcat(bufp, "\n"); |
|||
_msg(level, buff, syslp); |
|||
if (level >= diagopts.exitlevel) { |
|||
if (E_NOTICE >= diagopts.msglevel) { |
|||
snprintf_r(syslp, 16, "N exit(%d)\n", exitcode?exitcode:(diagopts.exitstatus?diagopts.exitstatus:1)); |
|||
_msg(E_NOTICE, buff, syslp); |
|||
} |
|||
exit(exitcode?exitcode:(diagopts.exitstatus?diagopts.exitstatus:1)); |
|||
} |
|||
} |
|||
|
|||
|
|||
static void _msg(int level, const char *buff, const char *syslp) { |
|||
if (diagopts.syslog) { |
|||
/* prevent format string attacks (thanks to CoKi) */ |
|||
syslog(syslevel[level], "%s", syslp); |
|||
} |
|||
if (diagopts.logfile) { |
|||
fputs(buff, diagopts.logfile); fflush(diagopts.logfile); |
|||
} |
|||
} |
|||
|
|||
|
|||
/* handle the messages in the queue */ |
|||
void diag_flush(void) { |
|||
struct diag_dgram recv_dgram; |
|||
char exitmsg[20]; |
|||
while (recv(diag_sock_recv, &recv_dgram, sizeof(recv_dgram)-1, MSG_DONTWAIT) > 0) { |
|||
recv_dgram.text[TEXTLEN-1] = '\0'; |
|||
switch (recv_dgram.op) { |
|||
case DIAG_OP_EXIT: |
|||
/* we want the actual time, not when this dgram was sent */ |
|||
#if HAVE_CLOCK_GETTIME |
|||
clock_gettime(CLOCK_REALTIME, &recv_dgram.now); |
|||
#elif HAVE_GETTIMEOFDAY |
|||
gettimeofday(&recv_dgram.now, NULL); |
|||
#else |
|||
recv_dgram.now = time(NULL); |
|||
#endif |
|||
if (E_NOTICE >= diagopts.msglevel) { |
|||
snprintf_r(exitmsg, sizeof(exitmsg), "exit(%d)", recv_dgram.exitcode?recv_dgram.exitcode:1); |
|||
msg2(&recv_dgram.now, E_NOTICE, recv_dgram.exitcode?recv_dgram.exitcode:1, 1, exitmsg); |
|||
} |
|||
exit(recv_dgram.exitcode?recv_dgram.exitcode:1); |
|||
case DIAG_OP_MSG: |
|||
if (recv_dgram._errno) { |
|||
/* there might be a %m control in the string (glibc compatible, |
|||
replace with strerror(...errno) ) */ |
|||
char text[TEXTLEN]; |
|||
errno = recv_dgram._errno; |
|||
snprinterr(text, TEXTLEN, recv_dgram.text); |
|||
msg2(&recv_dgram.now, recv_dgram.level, recv_dgram.exitcode, 1, text); |
|||
} else { |
|||
msg2(&recv_dgram.now, recv_dgram.level, recv_dgram.exitcode, 1, recv_dgram.text); |
|||
} |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
/* use a new log output file descriptor that is dup'ed from the current one. |
|||
this is useful when socat logs to stderr but fd 2 should be redirected to |
|||
serve other purposes */ |
|||
int diag_dup(void) { |
|||
int newfd; |
|||
|
|||
DIAG_INIT; |
|||
if (diagopts.logfile == NULL) { |
|||
return -1; |
|||
} |
|||
newfd = dup(fileno(diagopts.logfile)); |
|||
if (diagopts.logfile != stderr) { |
|||
fclose(diagopts.logfile); |
|||
} |
|||
if (newfd >= 0) { |
|||
diagopts.logfile = fdopen(newfd, "w"); |
|||
} |
|||
return newfd; |
|||
} |
|||
|
|||
|
|||
/* this function is kind of async-signal-safe exit(). When invoked from signal |
|||
handler it defers exit. */ |
|||
void diag_exit(int status) { |
|||
struct diag_dgram diag_dgram; |
|||
|
|||
if (diag_in_handler && !diag_immediate_exit) { |
|||
diag_dgram.op = DIAG_OP_EXIT; |
|||
diag_dgram.exitcode = status; |
|||
send(diag_sock_send, &diag_dgram, sizeof(diag_dgram)-TEXTLEN, MSG_DONTWAIT |
|||
#ifdef MSG_NOSIGNAL |
|||
|MSG_NOSIGNAL |
|||
#endif |
|||
); |
|||
return; |
|||
} |
|||
_diag_exit(status); |
|||
} |
|||
|
|||
static void _diag_exit(int status) { |
|||
Exit(status); |
|||
} |
|||
|
|||
|
|||
/* a function that appears to the application like select() but that also |
|||
monitors the diag socket diag_sock_recv and processes its messages. |
|||
Do not call from within a signal handler. */ |
|||
int diag_select(int nfds, fd_set *readfds, fd_set *writefds, |
|||
fd_set *exceptfds, struct timeval *timeout) { |
|||
int result; |
|||
fd_set save_readfds, save_writefds, save_exceptfds; |
|||
|
|||
if (readfds) { memcpy(&save_readfds, readfds, sizeof(*readfds)); } |
|||
if (writefds) { memcpy(&save_writefds, writefds, sizeof(*writefds)); } |
|||
if (exceptfds) { memcpy(&save_exceptfds, exceptfds, sizeof(*exceptfds)); } |
|||
|
|||
while (1) { |
|||
FD_SET(diag_sock_recv, readfds); |
|||
result = Select(nfds, readfds, writefds, |
|||
exceptfds, timeout); |
|||
if (!FD_ISSET(diag_sock_recv, readfds)) { |
|||
/* select terminated not due to diag_sock_recv, normalt continuation */ |
|||
break; |
|||
} |
|||
diag_flush(); |
|||
if (readfds) { memcpy(readfds, &save_readfds, sizeof(*readfds)); } |
|||
if (writefds) { memcpy(writefds, &save_writefds, sizeof(*writefds)); } |
|||
if (exceptfds) { memcpy(exceptfds, &save_exceptfds, sizeof(*exceptfds)); } |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@ -0,0 +1,249 @@ |
|||
/* source: error.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __error_h_included |
|||
#define __error_h_included 1 |
|||
|
|||
/* these must be defines because they are used by cpp! */ |
|||
#define E_DEBUG 0 /* all, including trace */ |
|||
#define E_INFO 1 /* all status changes etc. */ |
|||
#define E_NOTICE 2 /* all interesting, e.g. for firewall relay */ |
|||
#define E_WARN 3 /* all unusual */ |
|||
#define E_ERROR 4 /* errors */ |
|||
#define E_FATAL 5 /* emergency abort */ |
|||
|
|||
#define F_strerror "%m" /* a pseudo format, replaced by strerror(errno) */ |
|||
|
|||
/* here are the macros for diag invocation; use WITH_MSGLEVEL to specify the |
|||
lowest priority that is compiled into your program */ |
|||
#ifndef WITH_MSGLEVEL |
|||
# define WITH_MSGLEVEL E_NOTICE |
|||
#endif |
|||
|
|||
#if WITH_MSGLEVEL <= E_FATAL |
|||
#define Fatal(m) msg(E_FATAL,"%s",m) |
|||
#define Fatal1(m,a1) msg(E_FATAL,m,a1) |
|||
#define Fatal2(m,a1,a2) msg(E_FATAL,m,a1,a2) |
|||
#define Fatal3(m,a1,a2,a3) msg(E_FATAL,m,a1,a2,a3) |
|||
#define Fatal4(m,a1,a2,a3,a4) msg(E_FATAL,m,a1,a2,a3,a4) |
|||
#define Fatal5(m,a1,a2,a3,a4,a5) msg(E_FATAL,m,a1,a2,a3,a4,a5) |
|||
#define Fatal6(m,a1,a2,a3,a4,a5,a6) msg(E_FATAL,m,a1,a2,a3,a4,a5,a6) |
|||
#define Fatal7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_FATAL,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#else /* !(WITH_MSGLEVEL <= E_FATAL) */ |
|||
#define Fatal(m) |
|||
#define Fatal1(m,a1) |
|||
#define Fatal2(m,a1,a2) |
|||
#define Fatal3(m,a1,a2,a3) |
|||
#define Fatal4(m,a1,a2,a3,a4) |
|||
#define Fatal5(m,a1,a2,a3,a4,a5) |
|||
#define Fatal6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Fatal7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#endif /* !(WITH_MSGLEVEL <= E_FATAL) */ |
|||
|
|||
#if WITH_MSGLEVEL <= E_ERROR |
|||
#define Error(m) msg(E_ERROR,"%s",m) |
|||
#define Error1(m,a1) msg(E_ERROR,m,a1) |
|||
#define Error2(m,a1,a2) msg(E_ERROR,m,a1,a2) |
|||
#define Error3(m,a1,a2,a3) msg(E_ERROR,m,a1,a2,a3) |
|||
#define Error4(m,a1,a2,a3,a4) msg(E_ERROR,m,a1,a2,a3,a4) |
|||
#define Error5(m,a1,a2,a3,a4,a5) msg(E_ERROR,m,a1,a2,a3,a4,a5) |
|||
#define Error6(m,a1,a2,a3,a4,a5,a6) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6) |
|||
#define Error7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Error8(m,a1,a2,a3,a4,a5,a6,a7,a8) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Error9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Error10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Error11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) msg(E_ERROR,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#else /* !(WITH_MSGLEVEL >= E_ERROR) */ |
|||
#define Error(m) |
|||
#define Error1(m,a1) |
|||
#define Error2(m,a1,a2) |
|||
#define Error3(m,a1,a2,a3) |
|||
#define Error4(m,a1,a2,a3,a4) |
|||
#define Error5(m,a1,a2,a3,a4,a5) |
|||
#define Error6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Error7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Error8(m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Error9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Error10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Error11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#endif /* !(WITH_MSGLEVEL <= E_ERROR) */ |
|||
|
|||
#if WITH_MSGLEVEL <= E_WARN |
|||
#define Warn(m) msg(E_WARN,"%s",m) |
|||
#define Warn1(m,a1) msg(E_WARN,m,a1) |
|||
#define Warn2(m,a1,a2) msg(E_WARN,m,a1,a2) |
|||
#define Warn3(m,a1,a2,a3) msg(E_WARN,m,a1,a2,a3) |
|||
#define Warn4(m,a1,a2,a3,a4) msg(E_WARN,m,a1,a2,a3,a4) |
|||
#define Warn5(m,a1,a2,a3,a4,a5) msg(E_WARN,m,a1,a2,a3,a4,a5) |
|||
#define Warn6(m,a1,a2,a3,a4,a5,a6) msg(E_WARN,m,a1,a2,a3,a4,a5,a6) |
|||
#define Warn7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_WARN,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#else /* !(WITH_MSGLEVEL <= E_WARN) */ |
|||
#define Warn(m) |
|||
#define Warn1(m,a1) |
|||
#define Warn2(m,a1,a2) |
|||
#define Warn3(m,a1,a2,a3) |
|||
#define Warn4(m,a1,a2,a3,a4) |
|||
#define Warn5(m,a1,a2,a3,a4,a5) |
|||
#define Warn6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Warn7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#endif /* !(WITH_MSGLEVEL <= E_WARN) */ |
|||
|
|||
#if WITH_MSGLEVEL <= E_NOTICE |
|||
#define Notice(m) msg(E_NOTICE,"%s",m) |
|||
#define Notice1(m,a1) msg(E_NOTICE,m,a1) |
|||
#define Notice2(m,a1,a2) msg(E_NOTICE,m,a1,a2) |
|||
#define Notice3(m,a1,a2,a3) msg(E_NOTICE,m,a1,a2,a3) |
|||
#define Notice4(m,a1,a2,a3,a4) msg(E_NOTICE,m,a1,a2,a3,a4) |
|||
#define Notice5(m,a1,a2,a3,a4,a5) msg(E_NOTICE,m,a1,a2,a3,a4,a5) |
|||
#define Notice6(m,a1,a2,a3,a4,a5,a6) msg(E_NOTICE,m,a1,a2,a3,a4,a5,a6) |
|||
#define Notice7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_NOTICE,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Notice8(m,a1,a2,a3,a4,a5,a6,a7,a8) msg(E_NOTICE,m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Notice9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) msg(E_NOTICE,m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#else /* !(WITH_MSGLEVEL <= E_NOTICE) */ |
|||
#define Notice(m) |
|||
#define Notice1(m,a1) |
|||
#define Notice2(m,a1,a2) |
|||
#define Notice3(m,a1,a2,a3) |
|||
#define Notice4(m,a1,a2,a3,a4) |
|||
#define Notice5(m,a1,a2,a3,a4,a5) |
|||
#define Notice6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Notice7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Notice8(m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Notice9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#endif /* !(WITH_MSGLEVEL <= E_NOTICE) */ |
|||
|
|||
#if WITH_MSGLEVEL <= E_INFO |
|||
#define Info(m) msg(E_INFO,"%s",m) |
|||
#define Info1(m,a1) msg(E_INFO,m,a1) |
|||
#define Info2(m,a1,a2) msg(E_INFO,m,a1,a2) |
|||
#define Info3(m,a1,a2,a3) msg(E_INFO,m,a1,a2,a3) |
|||
#define Info4(m,a1,a2,a3,a4) msg(E_INFO,m,a1,a2,a3,a4) |
|||
#define Info5(m,a1,a2,a3,a4,a5) msg(E_INFO,m,a1,a2,a3,a4,a5) |
|||
#define Info6(m,a1,a2,a3,a4,a5,a6) msg(E_INFO,m,a1,a2,a3,a4,a5,a6) |
|||
#define Info7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_INFO,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Info8(m,a1,a2,a3,a4,a5,a6,a7,a8) msg(E_INFO,m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Info9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) msg(E_INFO,m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Info10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) msg(E_INFO,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Info11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) msg(E_INFO,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#else /* !(WITH_MSGLEVEL <= E_INFO) */ |
|||
#define Info(m) |
|||
#define Info1(m,a1) |
|||
#define Info2(m,a1,a2) |
|||
#define Info3(m,a1,a2,a3) |
|||
#define Info4(m,a1,a2,a3,a4) |
|||
#define Info5(m,a1,a2,a3,a4,a5) |
|||
#define Info6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Info7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Info8(m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Info9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Info10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Info11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#endif /* !(WITH_MSGLEVEL <= E_INFO) */ |
|||
|
|||
#if WITH_MSGLEVEL <= E_DEBUG |
|||
#define Debug(m) msg(E_DEBUG,"%s",m) |
|||
#define Debug1(m,a1) msg(E_DEBUG,m,a1) |
|||
#define Debug2(m,a1,a2) msg(E_DEBUG,m,a1,a2) |
|||
#define Debug3(m,a1,a2,a3) msg(E_DEBUG,m,a1,a2,a3) |
|||
#define Debug4(m,a1,a2,a3,a4) msg(E_DEBUG,m,a1,a2,a3,a4) |
|||
#define Debug5(m,a1,a2,a3,a4,a5) msg(E_DEBUG,m,a1,a2,a3,a4,a5) |
|||
#define Debug6(m,a1,a2,a3,a4,a5,a6) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6) |
|||
#define Debug7(m,a1,a2,a3,a4,a5,a6,a7) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Debug8(m,a1,a2,a3,a4,a5,a6,a7,a8) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Debug9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Debug10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Debug11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#define Debug12(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) |
|||
#define Debug13(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) |
|||
#define Debug14(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) |
|||
#define Debug15(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) |
|||
#define Debug16(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16) |
|||
#define Debug17(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17) |
|||
#define Debug18(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18) msg(E_DEBUG,m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18) |
|||
#else /* !(WITH_MSGLEVEL <= E_DEBUG) */ |
|||
#define Debug(m) |
|||
#define Debug1(m,a1) |
|||
#define Debug2(m,a1,a2) |
|||
#define Debug3(m,a1,a2,a3) |
|||
#define Debug4(m,a1,a2,a3,a4) |
|||
#define Debug5(m,a1,a2,a3,a4,a5) |
|||
#define Debug6(m,a1,a2,a3,a4,a5,a6) |
|||
#define Debug7(m,a1,a2,a3,a4,a5,a6,a7) |
|||
#define Debug8(m,a1,a2,a3,a4,a5,a6,a7,a8) |
|||
#define Debug9(m,a1,a2,a3,a4,a5,a6,a7,a8,a9) |
|||
#define Debug10(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) |
|||
#define Debug11(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) |
|||
#define Debug12(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) |
|||
#define Debug13(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) |
|||
#define Debug14(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) |
|||
#define Debug15(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) |
|||
#define Debug16(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16) |
|||
#define Debug17(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17) |
|||
#define Debug18(m,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18) |
|||
#endif /* !(WITH_MSGLEVEL <= E_DEBUG) */ |
|||
|
|||
/* message with software controlled serverity */ |
|||
#if WITH_MSGLEVEL <= E_FATAL |
|||
#define Msg(l,m) msg(l,"%s",m) |
|||
#define Msg1(l,m,a1) msg(l,m,a1) |
|||
#define Msg2(l,m,a1,a2) msg(l,m,a1,a2) |
|||
#define Msg3(l,m,a1,a2,a3) msg(l,m,a1,a2,a3) |
|||
#define Msg4(l,m,a1,a2,a3,a4) msg(l,m,a1,a2,a3,a4) |
|||
#define Msg5(l,m,a1,a2,a3,a4,a5) msg(l,m,a1,a2,a3,a4,a5) |
|||
#define Msg6(l,m,a1,a2,a3,a4,a5,a6) msg(l,m,a1,a2,a3,a4,a5,a6) |
|||
#define Msg7(l,m,a1,a2,a3,a4,a5,a6,a7) msg(l,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#else /* !(WITH_MSGLEVEL >= E_FATAL) */ |
|||
#define Msg(l,m) |
|||
#define Msg1(l,m,a1) |
|||
#define Msg2(l,m,a1,a2) |
|||
#define Msg3(l,m,a1,a2,a3) |
|||
#define Msg4(l,m,a1,a2,a3,a4) |
|||
#define Msg5(l,m,a1,a2,a3,a4,a5) |
|||
#define Msg6(l,m,a1,a2,a3,a4,a5,a6) |
|||
#define Msg7(l,m,a1,a2,a3,a4,a5,a6,a7) |
|||
#endif /* !(WITH_MSGLEVEL <= E_FATAL) */ |
|||
|
|||
|
|||
enum diag_op { |
|||
DIAG_OP_MSG, /* a diagnostic message */ |
|||
DIAG_OP_EXIT, /* exit the program */ |
|||
} ; |
|||
|
|||
/* datagram for communication between outer msg() call from signal handler to |
|||
inner msg() call in normal flow */ |
|||
# define TEXTLEN 480 |
|||
struct diag_dgram { |
|||
enum diag_op op; |
|||
#if HAVE_CLOCK_GETTIME |
|||
struct timespec now; |
|||
#elif HAVE_GETTIMEOFDAY |
|||
struct timeval now; |
|||
#else |
|||
time_t now; |
|||
#endif |
|||
int level; /* E_FATAL, ... E_DEBUG */ |
|||
int _errno; /* for glibc %m format */ |
|||
int exitcode; /* if exiting take this num */ |
|||
char text[TEXTLEN]; |
|||
} ; |
|||
|
|||
extern sig_atomic_t diag_in_handler; |
|||
extern sig_atomic_t diag_immediate_msg; |
|||
extern sig_atomic_t diag_immediate_exit; |
|||
|
|||
extern void diag_set(char what, const char *arg); |
|||
extern void diag_set_int(char what, int arg); |
|||
extern int diag_get_int(char what); |
|||
extern const char *diag_get_string(char what); |
|||
extern int diag_reserve_fd(int fd); |
|||
extern int diag_fork(void); |
|||
extern int diag_dup(void); |
|||
extern int diag_dup2(int newfd); |
|||
extern void msg(int level, const char *format, ...); |
|||
extern void diag_flush(void); |
|||
extern void diag_exit(int status); |
|||
extern int diag_select(int nfds, fd_set *readfds, fd_set *writefds, |
|||
fd_set *exceptfds, struct timeval *timeout); |
|||
|
|||
#endif /* !defined(__error_h_included) */ |
|||
@ -0,0 +1,329 @@ |
|||
/* source: fdname.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* the subroutine sockname prints the basic info about the address of a socket |
|||
NOTE: it works on UNIX (kernel) file descriptors, not on libc files! */ |
|||
|
|||
#include "config.h" |
|||
#include "xioconfig.h" /* what features are enabled */ |
|||
|
|||
#include "sysincludes.h" |
|||
|
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
#include "sysutils.h" |
|||
|
|||
#include "filan.h" |
|||
|
|||
|
|||
struct sockopt { |
|||
int so; |
|||
char *name; |
|||
}; |
|||
|
|||
|
|||
int statname(const char *file, int fd, int filetype, FILE *outfile); |
|||
int cdevname(int fd, FILE *outfile); |
|||
int sockname(int fd, FILE *outfile); |
|||
int unixame(int fd, FILE *outfile); |
|||
int tcpname(int fd, FILE *outfile); |
|||
|
|||
|
|||
int fdname(const char *file, int fd, FILE *outfile, const char *numform) { |
|||
struct stat buf = {0}; |
|||
int filetype; |
|||
Debug1("checking file descriptor %u", fd); |
|||
if (fd >= 0) { |
|||
if (Fstat(fd, &buf) < 0) { |
|||
if (errno == EBADF) { |
|||
Debug2("fstat(%d): %s", fd, strerror(errno)); |
|||
return -1; |
|||
} else { |
|||
Error2("fstat(%d): %s", fd, strerror(errno)); |
|||
} |
|||
} |
|||
filetype = (buf.st_mode&S_IFMT)>>12; |
|||
if (numform != NULL) { |
|||
fprintf(outfile, numform, fd); |
|||
} |
|||
return statname(file, fd, filetype, outfile); |
|||
} else { |
|||
if (Stat(file, &buf) < 0) { |
|||
Error2("stat(\"%s\"): %s", file, strerror(errno)); |
|||
} |
|||
filetype = (buf.st_mode&S_IFMT)>>12; |
|||
return statname(file, -1, filetype, outfile); |
|||
} |
|||
} |
|||
|
|||
#if HAVE_PROC_DIR_FD |
|||
static int procgetfdname(int fd, char *filepath, size_t pathsize) { |
|||
static pid_t pid = -1; |
|||
char procpath[PATH_MAX]; |
|||
int len; |
|||
|
|||
/* even if configure has shown that we have /proc, we must check if it |
|||
exists at runtime, because we might be in a chroot environment */ |
|||
#if HAVE_STAT64 |
|||
{ |
|||
struct stat64 buf; |
|||
if (Stat64("/proc", &buf) < 0) { |
|||
return -1; |
|||
} |
|||
if (!S_ISDIR(buf.st_mode)) { |
|||
return -1; |
|||
} |
|||
} |
|||
#else /* !HAVE_STAT64 */ |
|||
{ |
|||
struct stat buf; |
|||
if (Stat("/proc", &buf) < 0) { |
|||
return -1; |
|||
} |
|||
if (!S_ISDIR(buf.st_mode)) { |
|||
return -1; |
|||
} |
|||
} |
|||
#endif /* !HAVE_STAT64 */ |
|||
|
|||
if (pid < 0) pid = Getpid(); |
|||
snprintf(procpath, sizeof(procpath), "/proc/"F_pid"/fd/%d", pid, fd); |
|||
if ((len = Readlink(procpath, filepath, pathsize-1)) < 0) { |
|||
Error4("readlink(\"%s\", %p, "F_Zu"): %s", |
|||
procpath, filepath, pathsize, strerror(errno)); |
|||
return -1; |
|||
} |
|||
filepath[len] = '\0'; |
|||
return 0; |
|||
} |
|||
#endif /* HAVE_PROC_DIR_FD */ |
|||
|
|||
int statname(const char *file, int fd, int filetype, FILE *outfile) { |
|||
char filepath[PATH_MAX]; |
|||
|
|||
filepath[0] = '\0'; |
|||
#if HAVE_PROC_DIR_FD |
|||
if (fd >= 0) { |
|||
procgetfdname(fd, filepath, sizeof(filepath)); |
|||
if (filepath[0] == '/') { |
|||
file = filepath; |
|||
} |
|||
} |
|||
#endif /* HAVE_PROC_DIR_FD */ |
|||
/* now see for type specific infos */ |
|||
switch (filetype) { |
|||
case (S_IFIFO>>12): /* 1, FIFO */ |
|||
fputs("pipe", outfile); |
|||
if (file) fprintf(outfile, " %s", file); |
|||
break; |
|||
case (S_IFCHR>>12): /* 2, character device */ |
|||
if (cdevname(fd, outfile) == 0) { |
|||
if (file) fprintf(outfile, " %s", file); |
|||
} |
|||
break; |
|||
case (S_IFDIR>>12): /* 4, directory */ |
|||
fputs("dir", outfile); |
|||
if (file) fprintf(outfile, " %s", file); |
|||
break; |
|||
case (S_IFBLK>>12): /* 6, block device */ |
|||
fputs("blkdev", outfile); |
|||
if (file) fprintf(outfile, " %s", file); |
|||
break; |
|||
case (S_IFREG>>12): /* 8, regular file */ |
|||
fputs("file", outfile); |
|||
if (file) fprintf(outfile, " %s", file); |
|||
break; |
|||
case (S_IFLNK>>12): /* 10, symbolic link */ |
|||
fputs("link", outfile); |
|||
if (file) fprintf(outfile, " %s", file); |
|||
break; |
|||
case (S_IFSOCK>>12): /* 12, socket */ |
|||
#if _WITH_SOCKET |
|||
if (fd >= 0) { |
|||
sockname(fd, outfile); |
|||
} else if (file) { |
|||
fprintf(outfile, "socket %s", file); |
|||
} else { |
|||
fputs("socket", outfile); |
|||
} |
|||
#else |
|||
Error("SOCKET support not compiled in"); |
|||
return -1; |
|||
#endif /* !_WITH_SOCKET */ |
|||
break; |
|||
} |
|||
/* ioctl() */ |
|||
fputc('\n', outfile); |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
|
|||
/* character device analysis */ |
|||
/* return -1 on error, 0 if no name was found, or 1 if it printed ttyname */ |
|||
int cdevname(int fd, FILE *outfile) { |
|||
int ret; |
|||
|
|||
if ((ret = Isatty(fd)) < 0) { |
|||
Error2("isatty(%d): %s", fd, strerror(errno)); |
|||
return -1; |
|||
} |
|||
if (ret > 0) { |
|||
char *name; |
|||
|
|||
fputs("tty", outfile); |
|||
if ((name = Ttyname(fd)) != NULL) { |
|||
fputc(' ', outfile); |
|||
fputs(name, outfile); |
|||
return 1; |
|||
} |
|||
} else { |
|||
fputs("chrdev", outfile); |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
#if _WITH_SOCKET |
|||
int sockname(int fd, FILE *outfile) { |
|||
#define FDNAME_OPTLEN 256 |
|||
#define FDNAME_NAMELEN 256 |
|||
socklen_t optlen; |
|||
int opttype; |
|||
#ifdef SO_ACCEPTCONN |
|||
int optacceptconn; |
|||
#endif |
|||
int result /*0, i*/; |
|||
char namebuff[FDNAME_NAMELEN]; |
|||
char peerbuff[FDNAME_NAMELEN]; |
|||
/* in Linux these optcodes are 'enum', but on AIX they are bits! */ |
|||
union sockaddr_union sockname, peername; /* the longest I know of */ |
|||
socklen_t namelen; |
|||
#if 0 && defined(SIOCGIFNAME) |
|||
/*Linux struct ifreq ifc = {{{ 0 }}};*/ |
|||
struct ifreq ifc = {{ 0 }}; |
|||
#endif |
|||
|
|||
optlen = FDNAME_OPTLEN; |
|||
|
|||
Getsockopt(fd, SOL_SOCKET, SO_TYPE, &opttype, &optlen); |
|||
#ifdef SO_ACCEPTCONN |
|||
Getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &optacceptconn, &optlen); |
|||
#endif |
|||
|
|||
namelen = sizeof(sockname); |
|||
result = Getsockname(fd, &sockname.soa, &namelen); |
|||
if (result < 0) { |
|||
Error2("getsockname(%d): %s", fd, strerror(errno)); |
|||
return -1; |
|||
} |
|||
|
|||
namelen = sizeof(peername); |
|||
result = Getpeername(fd, (struct sockaddr *)&peername, &namelen); |
|||
if (result < 0) { |
|||
Error2("getpeername(%d): %s", fd, strerror(errno)); |
|||
} |
|||
|
|||
switch (sockname.soa.sa_family) { |
|||
#if WITH_UNIX |
|||
case AF_UNIX: |
|||
fprintf(outfile, "unix%s%s %s", |
|||
opttype==SOCK_DGRAM?"datagram":"", |
|||
#ifdef SO_ACCEPTCONN |
|||
optacceptconn?"(listening)": |
|||
#endif |
|||
"", |
|||
sockaddr_unix_info(&sockname.un, namelen, |
|||
namebuff, sizeof(namebuff))); |
|||
break; |
|||
#endif |
|||
#if WITH_IP4 |
|||
case AF_INET: |
|||
switch (opttype) { |
|||
#if WITH_TCP |
|||
case SOCK_STREAM: |
|||
fprintf(outfile, "tcp%s %s %s", |
|||
#ifdef SO_ACCEPTCONN |
|||
optacceptconn?"(listening)": |
|||
#endif |
|||
"", |
|||
sockaddr_inet4_info(&sockname.ip4, |
|||
namebuff, sizeof(namebuff)), |
|||
sockaddr_inet4_info(&peername.ip4, |
|||
peerbuff, sizeof(peerbuff))); |
|||
break; |
|||
#endif |
|||
#if WITH_UDP |
|||
case SOCK_DGRAM: |
|||
fprintf(outfile, "udp%s %s %s", |
|||
#ifdef SO_ACCEPTCONN |
|||
optacceptconn?"(listening)": |
|||
#endif |
|||
"", |
|||
sockaddr_inet4_info(&sockname.ip4, |
|||
namebuff, sizeof(namebuff)), |
|||
sockaddr_inet4_info(&peername.ip4, |
|||
peerbuff, sizeof(peerbuff))); |
|||
break; |
|||
#endif |
|||
default: |
|||
fprintf(outfile, "ip %s", |
|||
sockaddr_inet4_info(&sockname.ip4, |
|||
namebuff, sizeof(namebuff))); |
|||
break; |
|||
} |
|||
break; |
|||
#endif /* WITH_IP4 */ |
|||
|
|||
#if WITH_IP6 |
|||
case AF_INET6: |
|||
switch (opttype) { |
|||
#if WITH_TCP |
|||
case SOCK_STREAM: |
|||
fprintf(outfile, "tcp6%s %s %s", |
|||
#ifdef SO_ACCEPTCONN |
|||
optacceptconn?"(listening)": |
|||
#endif |
|||
"", |
|||
sockaddr_inet6_info(&sockname.ip6, |
|||
namebuff, sizeof(namebuff)), |
|||
sockaddr_inet6_info(&peername.ip6, |
|||
peerbuff, sizeof(peerbuff))); |
|||
break; |
|||
#endif |
|||
#if WITH_UDP |
|||
case SOCK_DGRAM: |
|||
fprintf(outfile, "udp6%s %s %s", |
|||
#ifdef SO_ACCEPTCONN |
|||
optacceptconn?"(listening)": |
|||
#endif |
|||
"", |
|||
sockaddr_inet6_info(&sockname.ip6, |
|||
namebuff, sizeof(namebuff)), |
|||
sockaddr_inet6_info(&peername.ip6, |
|||
peerbuff, sizeof(peerbuff))); |
|||
break; |
|||
#endif |
|||
default: |
|||
fprintf(outfile, "ip6 %s", |
|||
sockaddr_inet6_info(&sockname.ip6, |
|||
namebuff, sizeof(namebuff))); |
|||
break; |
|||
} |
|||
#endif /* WITH_IP6 */ |
|||
default: |
|||
fputs("socket", outfile); |
|||
} |
|||
|
|||
return result; |
|||
#undef FDNAME_OPTLEN |
|||
#undef FDNAME_NAMELEN |
|||
} |
|||
#endif /* _WITH_SOCKET */ |
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,990 @@ |
|||
/* source: filan.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* the subroutine filan makes a "FILe descriptor ANalysis". It checks the |
|||
type of file descriptor and tries to retrieve as much info about it as |
|||
possible without modifying its state. |
|||
NOTE: it works on UNIX (kernel) file descriptors, not on libc files! */ |
|||
|
|||
#include "config.h" |
|||
#include "xioconfig.h" /* what features are enabled */ |
|||
|
|||
#include "sysincludes.h" |
|||
|
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
#include "sysutils.h" |
|||
|
|||
#include "filan.h" |
|||
|
|||
|
|||
struct sockopt { |
|||
int so; |
|||
char *name; |
|||
}; |
|||
|
|||
static int filan_streams_analyze(int fd, FILE *outfile); |
|||
|
|||
/* dirty workaround so we dont get an error on AIX when being linked with |
|||
libwrap */ |
|||
int allow_severity, deny_severity; |
|||
|
|||
/* global variables for configuring filan */ |
|||
bool filan_followsymlinks; |
|||
bool filan_rawoutput; |
|||
|
|||
|
|||
int sockoptan(int fd, const struct sockopt *optname, int socklay, FILE *outfile); |
|||
int tcpan(int fd, FILE *outfile); |
|||
const char *getfiletypestring(int st_mode); |
|||
|
|||
static int printtime(FILE *outfile, time_t time); |
|||
|
|||
static int headprinted; |
|||
|
|||
/* analyse a file system entry, referred by file name */ |
|||
int filan_file(const char *filename, FILE *outfile) { |
|||
int fd = -1; |
|||
int result; |
|||
#if HAVE_STAT64 |
|||
struct stat64 buf = {0}; |
|||
#else |
|||
struct stat buf = {0}; |
|||
#endif /* !HAVE_STAT64 */ |
|||
|
|||
if (filan_followsymlinks) { |
|||
#if HAVE_STAT64 |
|||
result = Stat64(filename, &buf); |
|||
#else |
|||
result = Stat(filename, &buf); |
|||
#endif /* !HAVE_STAT64 */ |
|||
if (result < 0) { |
|||
Warn3("stat(\"%s\", %p): %s", filename, &buf, strerror(errno)); |
|||
} |
|||
} else { |
|||
#if HAVE_STAT64 |
|||
result = Lstat64(filename, &buf); |
|||
#else |
|||
result = Lstat(filename, &buf); |
|||
#endif /* !HAVE_STAT64 */ |
|||
if (result < 0) { |
|||
Warn3("lstat(\"%s\", %p): %s", filename, &buf, strerror(errno)); |
|||
} |
|||
} |
|||
switch (buf.st_mode&S_IFMT) { |
|||
#ifdef S_IFSOCK |
|||
case S_IFSOCK: /* probably, it's useless to make a socket and describe it */ |
|||
break; |
|||
#endif /* S_IFSOCK */ |
|||
default: |
|||
if ((fd = |
|||
Open(filename, O_RDONLY|O_NOCTTY|O_NONBLOCK |
|||
#ifdef O_LARGEFILE |
|||
|O_LARGEFILE |
|||
#endif |
|||
, 0700)) |
|||
< 0) { |
|||
Warn2("open(\"%s\", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0700): %s", |
|||
filename, strerror(errno)); |
|||
} |
|||
} |
|||
|
|||
result = filan_stat(&buf, fd, -1, outfile); |
|||
fputc('\n', outfile); |
|||
return result; |
|||
} |
|||
|
|||
/* analyze a file descriptor */ |
|||
int filan_fd(int fd, FILE *outfile) { |
|||
#if HAVE_STAT64 |
|||
struct stat64 buf = {0}; |
|||
#else |
|||
struct stat buf = {0}; |
|||
#endif /* !HAVE_STAT64 */ |
|||
int result; |
|||
|
|||
Debug1("checking file descriptor %u", fd); |
|||
#if HAVE_STAT64 |
|||
result = Fstat64(fd, &buf); |
|||
#else |
|||
result = Fstat(fd, &buf); |
|||
#endif /* !HAVE_STAT64 */ |
|||
if (result < 0) { |
|||
if (errno == EBADF) { |
|||
Debug2("fstat(%d): %s", fd, strerror(errno)); |
|||
} else { |
|||
Warn2("fstat(%d): %s", fd, strerror(errno)); |
|||
} |
|||
return -1; |
|||
} |
|||
Debug2("fd %d is a %s", fd, getfiletypestring(buf.st_mode)); |
|||
|
|||
result = filan_stat(&buf, fd, fd, outfile); |
|||
|
|||
if (result >= 0) { |
|||
/* even more dynamic info */ |
|||
{ /* see if data is available */ |
|||
struct pollfd ufds; |
|||
ufds.fd = fd; |
|||
ufds.events = POLLIN|POLLPRI|POLLOUT |
|||
#ifdef POLLRDNORM |
|||
|POLLRDNORM |
|||
#endif |
|||
#ifdef POLLRDBAND |
|||
|POLLRDBAND |
|||
#endif |
|||
|POLLWRNORM |
|||
#ifdef POLLWRBAND |
|||
|POLLWRBAND |
|||
#endif |
|||
#ifdef POLLMSG |
|||
|POLLMSG |
|||
#endif |
|||
; |
|||
#if HAVE_POLL |
|||
if (Poll(&ufds, 1, 0) < 0) { |
|||
Warn4("poll({%d, %hd, %hd}, 1, 0): %s", |
|||
ufds.fd, ufds.events, ufds.revents, strerror(errno)); |
|||
} else { |
|||
fputs("poll: ", outfile); |
|||
if (ufds.revents & POLLIN) fputs("IN,", outfile); |
|||
if (ufds.revents & POLLPRI) fputs("PRI,", outfile); |
|||
if (ufds.revents & POLLOUT) fputs("OUT,", outfile); |
|||
if (ufds.revents & POLLERR) fputs("ERR,", outfile); |
|||
if (ufds.revents & POLLNVAL) fputs("NVAL,", outfile); |
|||
#ifdef FIONREAD |
|||
if (ufds.revents & POLLIN) { |
|||
size_t sizet; |
|||
if ((result = Ioctl(fd, FIONREAD, &sizet) >= 0)) { |
|||
fprintf (outfile, "; FIONREAD="F_Zu, sizet); |
|||
} |
|||
} |
|||
#endif /* defined(FIONREAD) */ |
|||
#if _WITH_SOCKET && defined(MSG_DONTWAIT) |
|||
if ((ufds.revents & POLLIN) && isasocket(fd)) { |
|||
char _peername[SOCKADDR_MAX]; |
|||
struct sockaddr *pa = (struct sockaddr *)_peername; |
|||
struct msghdr msgh = {0}; |
|||
char peekbuff[1]; /* [0] fails with some compilers */ |
|||
#if HAVE_STRUCT_IOVEC |
|||
struct iovec iovec; |
|||
#endif |
|||
char ctrlbuff[5120]; |
|||
ssize_t bytes; |
|||
|
|||
fputs("; ", outfile); |
|||
msgh.msg_name = pa; |
|||
msgh.msg_namelen = sizeof(*pa); |
|||
#if HAVE_STRUCT_IOVEC |
|||
iovec.iov_base = peekbuff; |
|||
iovec.iov_len = sizeof(peekbuff); |
|||
msgh.msg_iov = &iovec; |
|||
msgh.msg_iovlen = 1; |
|||
#endif |
|||
#if HAVE_STRUCT_MSGHDR_MSGCONTROL |
|||
msgh.msg_control = ctrlbuff; |
|||
#endif |
|||
#if HAVE_STRUCT_MSGHDR_MSGCONTROLLEN |
|||
msgh.msg_controllen = sizeof(ctrlbuff); |
|||
#endif |
|||
#if HAVE_STRUCT_MSGHDR_MSGFLAGS |
|||
msgh.msg_flags = 0; |
|||
#endif |
|||
if ((bytes = Recvmsg(fd, &msgh, MSG_PEEK|MSG_DONTWAIT)) < 0) { |
|||
Warn1("recvmsg(): %s", strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, "recvmsg="F_Zd", ", bytes); |
|||
} |
|||
} |
|||
#endif /* _WITH_SOCKET && defined(MSG_DONTWAIT) */ |
|||
} |
|||
#endif /* HAVE_POLL */ |
|||
} |
|||
} |
|||
fputc('\n', outfile); |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
int filan_stat( |
|||
#if HAVE_STAT64 |
|||
struct stat64 *buf |
|||
#else |
|||
struct stat *buf |
|||
#endif /* !HAVE_STAT64 */ |
|||
, int statfd, int dynfd, FILE *outfile) { |
|||
char stdevstr[8]; |
|||
|
|||
/* print header */ |
|||
if (!headprinted) { |
|||
if (filan_rawoutput) { |
|||
fputs(" FD type\tdevice\tinode\tmode\tlinks\tuid\tgid" |
|||
#if HAVE_ST_RDEV |
|||
"\trdev" |
|||
#endif |
|||
"\tsize" |
|||
#if HAVE_ST_BLKSIZE |
|||
"\tblksize" |
|||
#endif |
|||
#if HAVE_ST_BLOCKS |
|||
"\tblocks" |
|||
#endif |
|||
"\tatime\t\tmtime\t\tctime\t\tcloexec\tflags" |
|||
#if defined(F_GETOWN) |
|||
"\tsigown" |
|||
#endif |
|||
, outfile); |
|||
} else /* !rawoutput */ { |
|||
fputs(" FD type\tdevice\tinode\tmode\tlinks\tuid\tgid" |
|||
#if HAVE_ST_RDEV |
|||
"\trdev" |
|||
#endif |
|||
"\tsize" |
|||
#if HAVE_ST_BLKSIZE |
|||
"\tblksize" |
|||
#endif |
|||
#if HAVE_ST_BLOCKS |
|||
"\tblocks" |
|||
#endif |
|||
"\tatime\t\t\t\tmtime\t\t\t\tctime\t\t\t\tcloexec\tflags" |
|||
#if defined(F_GETOWN) |
|||
"\tsigown" |
|||
#endif |
|||
, outfile); |
|||
|
|||
} /* endif !rawoutput */ |
|||
|
|||
#if defined(F_GETSIG) |
|||
fputs("\tsigio", outfile); |
|||
#endif /* defined(F_GETSIG) */ |
|||
fputc('\n', outfile); |
|||
headprinted = 1; |
|||
} |
|||
if (filan_rawoutput) { |
|||
snprintf(stdevstr, 8, F_dev, buf->st_dev); |
|||
} else { |
|||
snprintf(stdevstr, 8, "%hu,%hu", (unsigned short)(buf->st_dev>>8), (unsigned short)(buf->st_dev&0xff)); |
|||
} |
|||
fprintf(outfile, "%4d: %s\t%s\t" |
|||
#if HAVE_STAT64 |
|||
F_st64_ino |
|||
#else |
|||
F_st_ino |
|||
#endif /* HAVE_STAT64 */ |
|||
"\t"F_mode"\t"F_st_nlink"\t"F_uid"\t"F_gid |
|||
#if HAVE_ST_RDEV |
|||
"\t%hu,%hu" |
|||
#endif |
|||
"\t" |
|||
#if HAVE_STAT64 |
|||
F_st64_size |
|||
#else |
|||
F_st_size |
|||
#endif /* HAVE_STAT64 */ |
|||
#if HAVE_ST_BLKSIZE |
|||
"\t"F_st_blksize |
|||
#endif |
|||
#if HAVE_ST_BLOCKS |
|||
#if HAVE_STAT64 |
|||
"\t"F_st64_blocks |
|||
#else |
|||
"\t"F_st_blocks |
|||
#endif /* HAVE_STAT64 */ |
|||
#endif |
|||
, |
|||
(dynfd>=0?dynfd:statfd), getfiletypestring(buf->st_mode), |
|||
stdevstr, |
|||
buf->st_ino, |
|||
buf->st_mode, buf->st_nlink, buf->st_uid, |
|||
buf->st_gid, |
|||
#if HAVE_ST_RDEV |
|||
(unsigned short)(buf->st_rdev>>8), (unsigned short)(buf->st_rdev&0xff), |
|||
#endif |
|||
buf->st_size |
|||
#if HAVE_ST_BLKSIZE |
|||
, buf->st_blksize |
|||
#endif |
|||
#if HAVE_ST_BLOCKS |
|||
, buf->st_blocks /* on Linux, this applies to stat and stat64 */ |
|||
#endif |
|||
); |
|||
|
|||
printtime(outfile, buf->st_atime); |
|||
printtime(outfile, buf->st_mtime); |
|||
printtime(outfile, buf->st_ctime); |
|||
|
|||
#if 0 |
|||
{ |
|||
fputc('\t', outfile); |
|||
time = asctime(localtime(&buf->st_mtime)); |
|||
if (strchr(time, '\n')) *strchr(time, '\n') = '\0'; |
|||
fputs(time, outfile); |
|||
|
|||
fputc('\t', outfile); |
|||
time = asctime(localtime(&buf->st_ctime)); |
|||
if (strchr(time, '\n')) *strchr(time, '\n') = '\0'; |
|||
fputs(time, outfile); |
|||
} |
|||
#endif |
|||
|
|||
/* here comes dynamic info - it is only meaningful with preexisting FDs */ |
|||
if (dynfd >= 0) { /*!indent */ |
|||
int cloexec, flags; |
|||
#if defined(F_GETOWN) |
|||
int sigown; |
|||
#endif |
|||
#if defined(F_GETSIG) |
|||
int sigio; |
|||
#endif /* defined(F_GETSIG) */ |
|||
|
|||
cloexec = Fcntl(dynfd, F_GETFD); |
|||
flags = Fcntl(dynfd, F_GETFL); |
|||
#if defined(F_GETOWN) |
|||
sigown = Fcntl(dynfd, F_GETOWN); |
|||
#endif |
|||
#if defined(F_GETSIG) |
|||
sigio = Fcntl(dynfd, F_GETSIG); |
|||
#endif /* defined(F_GETSIG) */ |
|||
fprintf(outfile, "\t%d\tx%06x", cloexec, flags); |
|||
#if defined(F_GETOWN) |
|||
fprintf(outfile, "\t%d", sigown); |
|||
#endif |
|||
#if defined(F_GETSIG) |
|||
fprintf(outfile, "\t%d", sigio); |
|||
#endif /* defined(F_GETSIG) */ |
|||
} else { |
|||
fputs("\t\t" |
|||
#if defined(F_GETOWN) |
|||
"\t" |
|||
#endif |
|||
#if defined(F_GETSIG) |
|||
"\t" |
|||
#endif /* defined(F_GETSIG) */ |
|||
, outfile); |
|||
} |
|||
|
|||
/* ever heard of POSIX streams? here we handle these */ |
|||
filan_streams_analyze(statfd, outfile); |
|||
|
|||
/* now see for type specific infos */ |
|||
if (statfd >= 0) { /*!indent */ |
|||
switch (buf->st_mode&S_IFMT) { |
|||
case (S_IFIFO): /* 1, FIFO */ |
|||
break; |
|||
case (S_IFCHR): /* 2, character device */ |
|||
cdevan(statfd, outfile); |
|||
break; |
|||
case (S_IFDIR): /* 4, directory */ |
|||
break; |
|||
case (S_IFBLK): /* 6, block device */ |
|||
break; |
|||
case (S_IFREG): /* 8, regular file */ |
|||
break; |
|||
case (S_IFLNK): /* 10, symbolic link */ |
|||
break; |
|||
#ifdef S_IFSOCK |
|||
case (S_IFSOCK): /* 12, socket */ |
|||
#if _WITH_SOCKET |
|||
sockan(statfd, outfile); |
|||
#else |
|||
Warn("SOCKET support not compiled in"); |
|||
return -1; |
|||
#endif /* !_WITH_SOCKET */ |
|||
break; |
|||
#endif /* S_IFSOCK */ |
|||
} |
|||
} |
|||
/* ioctl() */ |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
#if LATER |
|||
int fdinfo(int fd) { |
|||
int result; |
|||
|
|||
result = Fcntl(fd, F_GETFD); |
|||
fcntl(fd, F_GETFL, ); |
|||
fcntl(fd, F_GETLK, ); |
|||
#ifdef F_GETOWN |
|||
fcntl(fd, F_GETOWN, ); |
|||
#endif |
|||
#ifdef F_GETSIG |
|||
fcntl(fd, F_GETSIG, ); |
|||
#endif |
|||
} |
|||
|
|||
|
|||
int devinfo(int fd) { |
|||
ioctl(); |
|||
} |
|||
#endif |
|||
|
|||
|
|||
/* returns 0 on success (not a stream descriptor, or no module) |
|||
returns <0 on failure */ |
|||
static int filan_streams_analyze(int fd, FILE *outfile) { |
|||
#ifdef I_LIST |
|||
# define SL_NMODS 8 /* max number of module names we can store */ |
|||
struct str_list modnames; |
|||
int i; |
|||
|
|||
if (!isastream(fd)) { |
|||
fprintf(outfile, "\t(no STREAMS modules)"); |
|||
return 0; |
|||
} |
|||
#if 0 /* uncomment for debugging */ |
|||
fprintf(outfile, "\tfind=%d", ioctl(fd, I_FIND, "ldterm")); |
|||
#endif |
|||
modnames.sl_nmods = ioctl(fd, I_LIST, 0); |
|||
if (modnames.sl_nmods < 0) { |
|||
fprintf(stderr, "ioctl(%d, I_LIST, 0): %s\n", fd, strerror(errno)); |
|||
return -1; |
|||
} |
|||
modnames.sl_modlist = Malloc(modnames.sl_nmods*(sizeof(struct str_mlist))); |
|||
if (modnames.sl_modlist == NULL) { |
|||
fprintf(stderr, "out of memory\n"); |
|||
return -1; |
|||
} |
|||
if (ioctl(fd, I_LIST, &modnames) < 0) { |
|||
fprintf(stderr, "ioctl(%d, I_LIST, %p): %s\n", |
|||
fd, &modnames, strerror(errno)); |
|||
free(modnames.sl_modlist); |
|||
return -1; |
|||
} |
|||
fprintf(outfile, "\tSTREAMS: "); |
|||
for (i = 0; i < modnames.sl_nmods; ++i) { |
|||
fprintf(outfile, "\"%s\"", modnames.sl_modlist[i].l_name); |
|||
if (i+1 < modnames.sl_nmods) fputc(',', outfile); |
|||
} |
|||
free(modnames.sl_modlist); |
|||
#endif /* defined(I_LIST) */ |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
/* character device analysis */ |
|||
int cdevan(int fd, FILE *outfile) { |
|||
int ret; |
|||
|
|||
#if _WITH_TERMIOS |
|||
if ((ret = Isatty(fd)) < 0) { |
|||
Warn2("isatty(%d): %s", fd, strerror(errno)); |
|||
return -1; |
|||
} |
|||
if (ret > 0) { |
|||
struct termios termarg; |
|||
char *name; |
|||
int i; |
|||
|
|||
if ((name = Ttyname(fd)) == NULL) { |
|||
/*Warn2("ttyname(%d): %s", fd, strerror(errno));*/ |
|||
fputs("\tNULL", outfile); |
|||
} else { |
|||
fprintf(outfile, "\t%s", name); |
|||
} |
|||
if (Tcgetattr(fd, &termarg) < 0) { |
|||
Warn3("tcgetattr(%d, %p): %s", fd, &termarg, strerror(errno)); |
|||
return -1; |
|||
} |
|||
fprintf(outfile, " \tIFLAGS=%08x OFLAGS=%08x CFLAGS=%08x LFLAGS=%08x", |
|||
(unsigned int)termarg.c_iflag, |
|||
(unsigned int)termarg.c_oflag, |
|||
(unsigned int)termarg.c_cflag, |
|||
(unsigned int)termarg.c_lflag); |
|||
|
|||
/* and the control characters */ |
|||
if (filan_rawoutput) { |
|||
for (i=0; i<NCCS; ++i) { |
|||
fprintf(outfile, " cc[%d]=%d", i, termarg.c_cc[i]); |
|||
} |
|||
} else { |
|||
for (i=0; i<NCCS; ++i) { |
|||
int ch; |
|||
unsigned char s[4]; |
|||
ch = termarg.c_cc[i]; |
|||
if (isprint(ch)) { |
|||
s[0] = ch; s[1]= '\0'; |
|||
} else if (ch < ' ') { |
|||
s[0] = '^'; s[1] = ch+'@'; s[2] = '\0'; |
|||
} else { |
|||
s[0] = 'x'; |
|||
s[1] = (ch>>4)>=10?(ch>>4)-10+'A':(ch>>4)+'0'; |
|||
s[2] = (ch&0x0f)>=10?(ch&0x0f)-10+'A':(ch&0x0f)+'0'; |
|||
s[3] = '\0'; |
|||
} |
|||
fprintf(outfile, " cc[%d]=%s", i, s); |
|||
} |
|||
} |
|||
} |
|||
#endif /* _WITH_TERMIOS */ |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
#if _WITH_SOCKET |
|||
int sockan(int fd, FILE *outfile) { |
|||
#define FILAN_OPTLEN 256 |
|||
#define FILAN_NAMELEN 256 |
|||
socklen_t optlen; |
|||
int result /*0, i*/; |
|||
static const char *socktypes[] = { |
|||
"undef", "STREAM", "DGRAM", "RAW", "RDM", |
|||
"SEQPACKET", "undef", "undef", "undef", "undef", |
|||
"PACKET", "undef" } ; |
|||
char nambuff[FILAN_NAMELEN]; |
|||
/* in Linux these optcodes are 'enum', but on AIX they are bits! */ |
|||
static const struct sockopt sockopts[] = { |
|||
{SO_DEBUG, "DEBUG"}, |
|||
{SO_REUSEADDR, "REUSEADDR"}, |
|||
{SO_TYPE, "TYPE"}, |
|||
{SO_ERROR, "ERROR"}, |
|||
#ifdef SO_PROTOTYPE |
|||
{SO_PROTOTYPE, "PROTOTYPE"}, |
|||
#endif |
|||
{SO_DONTROUTE, "DONTROUTE"}, |
|||
{SO_BROADCAST, "BROADCAST"}, |
|||
{SO_SNDBUF, "SNDBUF"}, |
|||
{SO_RCVBUF, "RCVBUF"}, |
|||
{SO_KEEPALIVE, "KEEPALIVE"}, |
|||
{SO_OOBINLINE, "OOBINLINE"}, |
|||
#ifdef SO_NO_CHECK |
|||
{SO_NO_CHECK, "NO_CHECK"}, |
|||
#endif |
|||
#ifdef SO_PRIORITY |
|||
{SO_PRIORITY, "PRIORITY"}, |
|||
#endif |
|||
{SO_LINGER, "LINGER"}, |
|||
#ifdef SO_BSDCOMPAT |
|||
{SO_BSDCOMPAT, "BSDCOMPAT"}, |
|||
#endif |
|||
#ifdef SO_REUSEPORT |
|||
{SO_REUSEPORT, "REUSEPORT"}, |
|||
#endif /* defined(SO_REUSEPORT) */ |
|||
#ifdef SO_PASSCRED |
|||
{SO_PASSCRED, "PASSCRED"}, |
|||
#endif |
|||
#ifdef SO_PEERCRED |
|||
{SO_PEERCRED, "PEERCRED"}, |
|||
#endif |
|||
#ifdef SO_RCVLOWAT |
|||
{SO_RCVLOWAT, "RCVLOWAT"}, |
|||
#endif |
|||
#ifdef SO_SNDLOWAT |
|||
{SO_SNDLOWAT, "SNDLOWAT"}, |
|||
#endif |
|||
#ifdef SO_RCVTIMEO |
|||
{SO_RCVTIMEO, "RCVTIMEO"}, |
|||
#endif |
|||
#ifdef SO_SNDTIMEO |
|||
{SO_SNDTIMEO, "SNDTIMEO"}, |
|||
#endif |
|||
#ifdef SO_SECURITY_AUTHENTICATION |
|||
{SO_SECURITY_AUTHENTICATION, "SECURITY_AUTHENTICATION"}, |
|||
#endif |
|||
#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT |
|||
{SO_SECURITY_ENCRYPTION_TRANSPORT, "SECURITY_ENCRYPTION_TRANSPORT"}, |
|||
#endif |
|||
#ifdef SO_SECURITY_ENCRYPTION_NETWORK |
|||
{SO_SECURITY_ENCRYPTION_NETWORK, "SECURITY_ENCRYPTION_NETWORK"}, |
|||
#endif |
|||
#ifdef SO_BINDTODEVICE |
|||
{SO_BINDTODEVICE, "BINDTODEVICE"}, |
|||
#endif |
|||
#ifdef SO_ATTACH_FILTER |
|||
{SO_ATTACH_FILTER, "ATTACH_FILTER"}, |
|||
#endif |
|||
#ifdef SO_DETACH_FILTER |
|||
{SO_DETACH_FILTER, "DETACH_FILTER"}, |
|||
#endif |
|||
{0, NULL} } ; |
|||
union { |
|||
char c[FILAN_OPTLEN]; |
|||
int i[FILAN_OPTLEN/sizeof(int)]; |
|||
} optval; |
|||
const struct sockopt *optname; |
|||
union sockaddr_union sockname, peername; /* the longest I know of */ |
|||
socklen_t namelen; |
|||
#if 0 && defined(SIOCGIFNAME) |
|||
/*Linux struct ifreq ifc = {{{ 0 }}};*/ |
|||
struct ifreq ifc = {{ 0 }}; |
|||
#endif |
|||
|
|||
optlen = FILAN_OPTLEN; |
|||
result = Getsockopt(fd, SOL_SOCKET, SO_TYPE, optval.c, &optlen); |
|||
if (result < 0) { |
|||
Debug4("getsockopt(%d, SOL_SOCKET, SO_TYPE, %p, {"F_socklen"}): %s", |
|||
fd, optval.c, optlen, strerror(errno)); |
|||
} else { |
|||
Debug3("fd %d: socket of type %d (\"%s\")", fd, *optval.i, |
|||
socktypes[*optval.i]); |
|||
} |
|||
|
|||
optname = sockopts; while (optname->so) { |
|||
optlen = FILAN_OPTLEN; |
|||
result = |
|||
Getsockopt(fd, SOL_SOCKET, optname->so, (void *)optval.c, &optlen); |
|||
if (result < 0) { |
|||
Debug5("getsockopt(%d, SOL_SOCKET, %d, %p, {"F_socklen"}): %s", |
|||
fd, optname->so, optval.c, optlen, strerror(errno)); |
|||
fputc('\t', outfile); |
|||
} else if (optlen == sizeof(int)) { |
|||
Debug2("getsockopt(,,, {%d}, %d)", |
|||
*optval.i, optlen); |
|||
/*Info2("%s: %d", optname->name, optval.i);*/ |
|||
fprintf(outfile, "%s=%d\t", optname->name, *optval.i); |
|||
} else { |
|||
Debug3("getsockopt(,,, {%d,%d}, %d)", |
|||
optval.i[0], optval.i[1], optlen); |
|||
fprintf(outfile, "%s={%d,%d}\t", optname->name, |
|||
optval.i[0], optval.i[1]); |
|||
} |
|||
++optname; |
|||
} |
|||
|
|||
namelen = sizeof(sockname); |
|||
result = Getsockname(fd, (struct sockaddr *)&sockname, &namelen); |
|||
if (result < 0) { |
|||
putc('\n', outfile); |
|||
Warn2("getsockname(%d): %s", fd, strerror(errno)); |
|||
return -1; |
|||
} |
|||
fputc('\t', outfile); |
|||
fputs(sockaddr_info((struct sockaddr *)&sockname, namelen, nambuff, sizeof(nambuff)), |
|||
outfile); |
|||
|
|||
namelen = sizeof(peername); |
|||
result = Getpeername(fd, (struct sockaddr *)&peername, &namelen); |
|||
if (result < 0) { |
|||
putc('\n', outfile); |
|||
Warn2("getpeername(%d): %s", fd, strerror(errno)); |
|||
} else { |
|||
/* only valid if getpeername() succeeded */ |
|||
fputs(" <-> ", outfile); |
|||
fprintf(outfile, "%s\t", |
|||
sockaddr_info((struct sockaddr *)&peername, namelen, |
|||
nambuff, sizeof(nambuff))); |
|||
} |
|||
|
|||
#if 0 && defined(SIOCGIFNAME) |
|||
if ((result = Ioctl(fd, SIOCGIFNAME, &ifc)) < 0) { |
|||
Warn3("ioctl(%d, SIOCGIFNAME, %p): %s", fd, &ifc, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, "IFNAME=\"%s\"\t", ifc.ifr_name); |
|||
} |
|||
#endif /* SIOCGIFNAME */ |
|||
|
|||
switch (((struct sockaddr *)&sockname)->sa_family) { |
|||
#if WITH_UNIX |
|||
case AF_UNIX: |
|||
/* no options for unix domain sockets known yet -> no unixan() */ |
|||
result = 0; |
|||
break; |
|||
#endif |
|||
#if WITH_IP4 |
|||
case AF_INET: |
|||
result = ipan(fd, outfile); |
|||
break; |
|||
#endif |
|||
#if WITH_IP6 |
|||
case AF_INET6: |
|||
result = ipan(fd, outfile); |
|||
result |= ip6an(fd, outfile); |
|||
break; |
|||
#endif |
|||
default: |
|||
fputs("**** NO FURTHER ANALYSIS FOR THIS SOCKET TYPE IMPLEMENTED", outfile); |
|||
result = 0; |
|||
} |
|||
return result; |
|||
#undef FILAN_OPTLEN |
|||
#undef FILAN_NAMELEN |
|||
} |
|||
#endif /* _WITH_SOCKET */ |
|||
|
|||
|
|||
#if WITH_IP4 || WITH_IP6 |
|||
/* prints the option values for the IP protocol and the IP based protocols */ |
|||
/* no distinction between IP4 and IP6 yet */ |
|||
int ipan(int fd, FILE *outfile) { |
|||
/* in Linux these optcodes are 'enum', but on AIX they are bits! */ |
|||
static const struct sockopt ipopts[] = { |
|||
{IP_TOS, "IP_TOS"}, |
|||
{IP_TTL, "IP_TTL"}, |
|||
#ifdef IP_HDRINCL |
|||
{IP_HDRINCL, "IP_HDRINCL"}, |
|||
#endif |
|||
#ifdef IP_OPTIONS |
|||
{IP_OPTIONS, "IP_OPTIONS"}, |
|||
#endif |
|||
#ifdef IP_ROUTER_ALERT |
|||
{IP_ROUTER_ALERT, "IP_ROUTER_ALERT"}, |
|||
#endif |
|||
#ifdef IP_RECVOPTS |
|||
{IP_RECVOPTS, "IP_RECVOPTS"}, |
|||
#endif |
|||
#ifdef IP_RETOPTS |
|||
{IP_RETOPTS, "IP_RETOPTS"}, |
|||
#endif |
|||
#ifdef IP_PKTINFO |
|||
{IP_PKTINFO, "IP_PKTINFO"}, |
|||
#endif |
|||
#ifdef IP_PKTOPTIONS |
|||
{IP_PKTOPTIONS, "IP_PKTOPTIONS"}, |
|||
#endif |
|||
#ifdef IP_MTU_DISCOVER |
|||
{IP_MTU_DISCOVER, "IP_MTU_DISCOVER"}, |
|||
#endif |
|||
#ifdef IP_RECVERR |
|||
{IP_RECVERR, "IP_RECVERR"}, |
|||
#endif |
|||
#ifdef IP_RECVTTL |
|||
{IP_RECVTTL, "IP_RECVTTL"}, |
|||
#endif |
|||
#ifdef IP_RECVTOS |
|||
{IP_RECVTOS, "IP_RECVTOS"}, |
|||
#endif |
|||
#ifdef IP_MTU |
|||
{IP_MTU, "IP_MTU"}, |
|||
#endif |
|||
#ifdef IP_FREEBIND |
|||
{IP_FREEBIND, "IP_FREEBIND"}, |
|||
#endif |
|||
#ifdef IP_MULTICAST_TTL |
|||
{IP_MULTICAST_TTL, "IP_MULTICAST_TTL"}, |
|||
#endif |
|||
#ifdef IP_MULTICAST_LOOP |
|||
{IP_MULTICAST_LOOP, "IP_MULTICAST_LOOP"}, |
|||
#endif |
|||
{0, NULL} } ; |
|||
const struct sockopt *optname; |
|||
int opttype; |
|||
socklen_t optlen = sizeof(opttype); |
|||
|
|||
optname = ipopts; while (optname->so) { |
|||
sockoptan(fd, optname, SOL_IP, outfile); |
|||
++optname; |
|||
} |
|||
/* want to pass the fd to the next layer protocol. dont know how to get the |
|||
protocol number from the fd? use TYPE to identify TCP. */ |
|||
if (Getsockopt(fd, SOL_SOCKET, SO_TYPE, &opttype, &optlen) >= 0) { |
|||
switch (opttype) { |
|||
#if WITH_TCP |
|||
case SOCK_STREAM: tcpan(fd, outfile); break; |
|||
#endif |
|||
} |
|||
} |
|||
return 0; |
|||
} |
|||
#endif /* WITH_IP */ |
|||
|
|||
|
|||
#if WITH_IP6 |
|||
/* prints the option values for the IPv6 protocol */ |
|||
int ip6an(int fd, FILE *outfile) { |
|||
static const struct sockopt ip6opts[] = { |
|||
#ifdef IPV6_V6ONLY |
|||
{IPV6_V6ONLY, "IPV6_V6ONLY"}, |
|||
#endif |
|||
{0, NULL} } ; |
|||
const struct sockopt *optname; |
|||
|
|||
optname = ip6opts; while (optname->so) { |
|||
sockoptan(fd, optname, SOL_IPV6, outfile); |
|||
++optname; |
|||
} |
|||
return 0; |
|||
} |
|||
#endif /* WITH_IP6 */ |
|||
|
|||
|
|||
#if WITH_TCP |
|||
int tcpan(int fd, FILE *outfile) { |
|||
static const struct sockopt tcpopts[] = { |
|||
#ifdef TCP_NODELAY |
|||
{ TCP_NODELAY, "TCP_NODELAY" }, |
|||
#endif |
|||
#ifdef TCP_MAXSEG |
|||
{ TCP_MAXSEG, "TCP_MAXSEG" }, |
|||
#endif |
|||
#ifdef TCP_STDURG |
|||
{ TCP_STDURG, "TCP_STDURG" }, |
|||
#endif |
|||
#ifdef TCP_RFC1323 |
|||
{ TCP_RFC1323, "TCP_RFC1323" }, |
|||
#endif |
|||
#ifdef TCP_CORK |
|||
{ TCP_CORK, "TCP_CORK" }, |
|||
#endif |
|||
#ifdef TCP_KEEPIDLE |
|||
{ TCP_KEEPIDLE, "TCP_KEEPIDLE" }, |
|||
#endif |
|||
#ifdef TCP_KEEPINTVL |
|||
{ TCP_KEEPINTVL, "TCP_KEEPINTVL" }, |
|||
#endif |
|||
#ifdef TCP_KEEPCNT |
|||
{ TCP_KEEPCNT, "TCP_KEEPCNT" }, |
|||
#endif |
|||
#ifdef TCP_SYNCNT |
|||
{ TCP_SYNCNT, "TCP_SYNCNT" }, |
|||
#endif |
|||
#ifdef TCP_LINGER2 |
|||
{ TCP_LINGER2, "TCP_LINGER2" }, |
|||
#endif |
|||
#ifdef TCP_DEFER_ACCEPT |
|||
{ TCP_DEFER_ACCEPT, "TCP_ACCEPT" }, |
|||
#endif |
|||
#ifdef TCP_WINDOW_CLAMP |
|||
{ TCP_WINDOW_CLAMP, "TCP_WINDOW_CLAMP" }, |
|||
#endif |
|||
#ifdef TCP_INFO |
|||
{ TCP_INFO, "TCP_INFO" }, |
|||
#endif |
|||
#ifdef TCP_QUICKACK |
|||
{ TCP_QUICKACK, "TCP_QUICKACK" }, |
|||
#endif |
|||
#ifdef TCP_MD5SIG |
|||
{ TCP_MD5SIG, "TCP_MD5SIG" }, |
|||
#endif |
|||
#ifdef TCP_NOOPT |
|||
{ TCP_NOOPT, "TCP_NOOPT" }, |
|||
#endif |
|||
#ifdef TCP_NOPUSH |
|||
{ TCP_NOPUSH, "TCP_NOPUSH" }, |
|||
#endif |
|||
#ifdef TCP_SACK_DISABLE |
|||
{ TCP_SACK_DISABLE, "TCP_SACK_DISABLE" }, |
|||
#endif |
|||
#ifdef TCP_SIGNATURE_ENABLE |
|||
{ TCP_SIGNATURE_ENABLE, "TCP_SIGNATURE_ENABLE" }, |
|||
#endif |
|||
#ifdef TCP_ABORT_THRESHOLD |
|||
{ TCP_ABORT_THRESHOLD, "TCP_ABORT_THRESHOLD" }, |
|||
#endif |
|||
#ifdef TCP_CONN_ABORT_THRESHOLD |
|||
{ TCP_CONN_ABORT_THRESHOLD, "TCP_CONN_ABORT_THRESHOLD" }, |
|||
#endif |
|||
#ifdef TCP_KEEPINIT |
|||
{ TCP_KEEPINIT, "TCP_KEEPINIT" }, |
|||
#endif |
|||
#ifdef TCP_PAWS |
|||
{ TCP_PAWS, "TCP_PAWS" }, |
|||
#endif |
|||
#ifdef TCP_SACKENA |
|||
{ TCP_SACKENA, "TCP_SACKENA" }, |
|||
#endif |
|||
#ifdef TCP_TSOPTENA |
|||
{ TCP_TSOPTENA, "TCP_TSOPTENA" }, |
|||
#endif |
|||
{0, NULL} |
|||
} ; |
|||
const struct sockopt *optname; |
|||
|
|||
optname = tcpopts; while (optname->so) { |
|||
sockoptan(fd, optname, SOL_TCP, outfile); |
|||
++optname; |
|||
} |
|||
return 0; |
|||
} |
|||
#endif /* WITH_TCP */ |
|||
|
|||
|
|||
#if _WITH_SOCKET |
|||
int sockoptan(int fd, const struct sockopt *optname, int socklay, FILE *outfile) { |
|||
#define FILAN_OPTLEN 256 |
|||
union { |
|||
char c[FILAN_OPTLEN]; |
|||
int i[FILAN_OPTLEN/sizeof(int)]; |
|||
} optval; |
|||
socklen_t optlen; |
|||
int result; |
|||
|
|||
optlen = FILAN_OPTLEN; |
|||
result = |
|||
Getsockopt(fd, socklay, optname->so, (void *)optval.c, &optlen); |
|||
if (result < 0) { |
|||
Debug6("getsockopt(%d, %d, %d, %p, {"F_socklen"}): %s", |
|||
fd, socklay, optname->so, optval.c, optlen, strerror(errno)); |
|||
fputc('\t', outfile); |
|||
return -1; |
|||
} else if (optlen == 0) { |
|||
Debug1("getsockopt(,,, {}, %d)", optlen); |
|||
fprintf(outfile, "%s=\"\"\t", optname->name); |
|||
} else if (optlen == sizeof(int)) { |
|||
Debug2("getsockopt(,,, {%d}, %d)", |
|||
*optval.i, optlen); |
|||
fprintf(outfile, "%s=%d\t", optname->name, *optval.i); |
|||
} else { |
|||
char outbuf[FILAN_OPTLEN*9+128], *cp = outbuf; |
|||
int i; |
|||
for (i = 0; i < optlen/sizeof(unsigned int); ++i) { |
|||
cp += sprintf(cp, "%08x ", (unsigned int)optval.i[i]); |
|||
} |
|||
*--cp = '\0'; /* delete trailing space */ |
|||
Debug2("getsockopt(,,, {%s}, %d)", outbuf, optlen); |
|||
fflush(outfile); |
|||
fprintf(outfile, "%s={%s}\t", optname->name, outbuf); |
|||
} |
|||
return 0; |
|||
#undef FILAN_OPTLEN |
|||
} |
|||
#endif /* _WITH_SOCKET */ |
|||
|
|||
|
|||
#if _WITH_SOCKET |
|||
int isasocket(int fd) { |
|||
int retval; |
|||
#if HAVE_STAT64 |
|||
struct stat64 props; |
|||
#else |
|||
struct stat props; |
|||
#endif /* HAVE_STAT64 */ |
|||
retval = |
|||
#if HAVE_STAT64 |
|||
Fstat64(fd, &props); |
|||
#else |
|||
Fstat(fd, &props); |
|||
#endif |
|||
if (retval < 0) { |
|||
Info3("fstat(%d, %p): %s", fd, &props, strerror(errno)); |
|||
return 0; |
|||
} |
|||
/* note: when S_ISSOCK was undefined, it always gives 0 */ |
|||
return S_ISSOCK(props.st_mode); |
|||
} |
|||
#endif /* _WITH_SOCKET */ |
|||
|
|||
|
|||
const char *getfiletypestring(int st_mode) { |
|||
const char *s; |
|||
|
|||
switch (st_mode&S_IFMT) { |
|||
case S_IFIFO: s = "pipe"; break; |
|||
case S_IFCHR: s = "chrdev"; break; |
|||
case S_IFDIR: s = "dir"; break; |
|||
case S_IFBLK: s = "blkdev"; break; |
|||
case S_IFREG: s = "file"; break; |
|||
case S_IFLNK: s = "symlink"; break; |
|||
case S_IFSOCK: s = "socket"; break; |
|||
/*! AIX: MT? */ |
|||
default: s = "undef"; break; |
|||
} |
|||
return s; |
|||
} |
|||
|
|||
static int printtime(FILE *outfile, time_t time) { |
|||
const char *s; |
|||
|
|||
if (filan_rawoutput) { |
|||
fprintf(outfile, "\t"F_time, time); |
|||
} else { |
|||
fputc('\t', outfile); |
|||
s = asctime(localtime(&time)); |
|||
if (strchr(s, '\n')) *strchr(s, '\n') = '\0'; |
|||
fputs(s, outfile); |
|||
} |
|||
return 0; |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
/* source: filan.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
|
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __filan_h_included |
|||
#define __filan_h_included 1 |
|||
|
|||
struct sockaddr; /* prevent gcc from spitting silly warning */ |
|||
struct sockaddr_un; /* prevent gcc from spitting silly warning */ |
|||
struct sockaddr_in; /* prevent gcc from spitting silly warning */ |
|||
struct sockaddr_in6; /* prevent gcc from spitting silly warning */ |
|||
|
|||
extern bool filan_followsymlinks; |
|||
extern bool filan_rawoutput; |
|||
|
|||
extern int filan_file(const char *filename, FILE *outfile); |
|||
extern int filan_fd(int fd, FILE *outfile); |
|||
extern int filan_stat( |
|||
#if HAVE_STAT64 |
|||
struct stat64 *buf |
|||
#else |
|||
struct stat *buf |
|||
#endif /* !HAVE_STAT64 */ |
|||
, int statfd, int dynfd, FILE *outfile); |
|||
|
|||
extern int cdevan(int fd, FILE *outfile); |
|||
|
|||
#if _WITH_SOCKET |
|||
extern int isasocket(int fd); |
|||
extern int sockan(int fd, FILE *outfile); |
|||
extern int ipan(int fd, FILE *outfile); |
|||
extern int ip6an(int fd, FILE *outfile); |
|||
#endif /* _WITH_SOCKET */ |
|||
|
|||
extern |
|||
int fdname(const char *file, int fd, FILE *outfile, const char *numform); |
|||
|
|||
#endif /* !defined(__filan_h_included) */ |
|||
@ -0,0 +1,248 @@ |
|||
/* source: filan_main.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
const char copyright[] = "filan by Gerhard Rieger and contributors - see http://www.dest-unreach.org/socat/"; |
|||
|
|||
#include "config.h" |
|||
#include "xioconfig.h" |
|||
#include "sysincludes.h" |
|||
|
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
#include "filan.h" |
|||
|
|||
|
|||
#define WITH_HELP 1 |
|||
|
|||
static void filan_usage(FILE *fd); |
|||
|
|||
|
|||
int main(int argc, const char *argv[]) { |
|||
const char **arg1, *a; |
|||
const char *filename = NULL, *waittimetxt; |
|||
unsigned int m = 0; /* first FD (default) */ |
|||
unsigned int n = FD_SETSIZE; /* last excl. */ |
|||
unsigned int i; |
|||
int style = 0; |
|||
struct timespec waittime = { 0, 0 }; |
|||
FILE *fdout = stdout; |
|||
const char *outfname = NULL; |
|||
unsigned long fildes; |
|||
|
|||
diag_set('p', strchr(argv[0], '/') ? strrchr(argv[0], '/')+1 : argv[0]); |
|||
|
|||
arg1 = argv+1; --argc; |
|||
while (arg1[0] && (arg1[0][0] == '-')) { |
|||
switch (arg1[0][1]) { |
|||
#if WITH_HELP |
|||
case '?': case 'h': |
|||
filan_usage(stdout); exit(0); |
|||
#endif |
|||
#if LATER |
|||
case 'V': filan_version(stdout); exit(0); |
|||
#endif |
|||
case 'L': filan_followsymlinks = true; break; |
|||
case 'd': diag_set('d', NULL); break; |
|||
case 's': style = 1; break; |
|||
case 'r': filan_rawoutput = true; break; |
|||
case 'i': if (arg1[0][2]) { |
|||
a = *arg1+2; |
|||
} else { |
|||
++arg1, --argc; |
|||
if ((a = *arg1) == NULL) { |
|||
Error("option -i requires an argument"); |
|||
filan_usage(stderr); exit(1); |
|||
} |
|||
} |
|||
m = strtoul(a, (char **)&a, 0); |
|||
n = m; |
|||
break; |
|||
case 'n': if (arg1[0][2]) { |
|||
a = *arg1+2; |
|||
} else { |
|||
++arg1, --argc; |
|||
if ((a = *arg1) == NULL) { |
|||
Error("option -n requires an argument"); |
|||
filan_usage(stderr); exit(1); |
|||
} |
|||
} |
|||
n = strtoul(a, (char **)&a, 0); |
|||
break; |
|||
case 'f': if (arg1[0][2]) { |
|||
filename = *arg1+2; |
|||
} else { |
|||
++arg1, --argc; |
|||
if ((filename = *arg1) == NULL) { |
|||
Error("option -f requires an argument"); |
|||
filan_usage(stderr); exit(1); |
|||
} |
|||
} |
|||
break; |
|||
case 'T': if (arg1[0][2]) { |
|||
waittimetxt = *arg1+2; |
|||
} else { |
|||
++arg1, --argc; |
|||
if ((waittimetxt = *arg1) == NULL) { |
|||
Error("option -T requires an argument"); |
|||
filan_usage(stderr); exit(1); |
|||
} |
|||
} |
|||
{ |
|||
double waittimedbl; |
|||
waittimedbl = strtod(waittimetxt, NULL); |
|||
waittime.tv_sec = waittimedbl; |
|||
waittime.tv_nsec = (waittimedbl-waittime.tv_sec) * 1000000000; |
|||
} |
|||
break; |
|||
case 'o': if (arg1[0][2]) { |
|||
outfname = *arg1+2; |
|||
} else { |
|||
++arg1, --argc; |
|||
if ((outfname = *arg1) == NULL) { |
|||
Error("option -o requires an argument"); |
|||
filan_usage(stderr); exit(1); |
|||
} |
|||
} |
|||
break; |
|||
case '\0': break; |
|||
default: |
|||
diag_set_int('e', E_FATAL); |
|||
Error1("unknown option %s", arg1[0]); |
|||
#if WITH_HELP |
|||
filan_usage(stderr); |
|||
#endif |
|||
exit(1); |
|||
} |
|||
#if 0 |
|||
if (arg1[0][1] == '\0') |
|||
break; |
|||
#endif |
|||
++arg1; --argc; |
|||
} |
|||
if (argc != 0) { |
|||
Error1("%d superfluous arguments", argc); |
|||
filan_usage(stderr); |
|||
exit(1); |
|||
} |
|||
if (outfname) { |
|||
/* special cases */ |
|||
if (!strcmp(outfname,"stdin")) { fdout=stdin; } |
|||
else if (!strcmp(outfname,"stdout")) { fdout=stdout; } |
|||
else if (!strcmp(outfname,"stderr")) { fdout=stderr; } |
|||
/* file descriptor */ |
|||
else if (*outfname == '+') { |
|||
a = outfname+1; |
|||
fildes = strtoul(a, (char **)&a, 0); |
|||
if ((fdout = fdopen(fildes, "w")) == NULL) { |
|||
Error2("can't fdopen file descriptor %lu: %s\n", fildes, strerror(errno)); |
|||
exit(1); |
|||
} |
|||
} else { |
|||
/* file name */ |
|||
if ((fdout = fopen(outfname, "w")) == NULL) { |
|||
Error2("can't fopen '%s': %s\n", |
|||
outfname, strerror(errno)); |
|||
exit(1); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Nanosleep(&waittime, NULL); |
|||
|
|||
if (style == 0) { |
|||
/* this style gives detailled infos, but requires a file descriptor */ |
|||
if (filename) { |
|||
#if LATER /* this is just in case that S_ISSOCK does not work */ |
|||
struct stat buf; |
|||
int fd; |
|||
|
|||
if (Stat(filename, &buf) < 0) { |
|||
Error3("stat(\"%s\", %p): %s", filename, &buf, strerror(errno)); |
|||
} |
|||
/* note: when S_ISSOCK was undefined, it always gives 0 */ |
|||
if (S_ISSOCK(buf.st_mode)) { |
|||
Error("cannot analyze UNIX domain socket"); |
|||
} |
|||
#endif |
|||
filan_file(filename, fdout); |
|||
} else { |
|||
if (m == n) { |
|||
++n; |
|||
} |
|||
for (i = m; i < n; ++i) { |
|||
filan_fd(i, fdout); |
|||
} |
|||
} |
|||
} else { |
|||
/* this style gives only type and path / socket addresses, and works from |
|||
file descriptor or filename (with restrictions) */ |
|||
if (filename) { |
|||
/* filename: NULL means yet unknown; "" means no name at all */ |
|||
#if LATER |
|||
int fd; |
|||
if ((fd = |
|||
Open(filename, O_RDONLY|O_NOCTTY|O_NONBLOCK |
|||
#ifdef O_LARGEFILE |
|||
|O_LARGEFILE |
|||
#endif |
|||
, 0700)) |
|||
< 0) { |
|||
Debug2("open(\"%s\", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0700): %s", |
|||
filename, strerror(errno)); |
|||
} |
|||
fdname(filename, fd, fdout, NULL); |
|||
#endif |
|||
fdname(filename, -1, fdout, NULL); |
|||
} else { |
|||
if (m == n) { |
|||
fdname("", m, fdout, NULL); |
|||
} else { |
|||
for (i = m; i < n; ++i) { |
|||
fdname("", i, fdout, "%5u "); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if (outfname && fdout != stdout && fdout != stderr) { |
|||
fclose(fdout); |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
#if WITH_HELP |
|||
static void filan_usage(FILE *fd) { |
|||
fputs(copyright, fd); fputc('\n', fd); |
|||
fputs("Analyze file descriptors of the process\n", fd); |
|||
fputs("Usage:\n", fd); |
|||
fputs("filan [options]\n", fd); |
|||
fputs(" options:\n", fd); |
|||
#if LATER |
|||
fputs(" -V print version information to stdout, and exit\n", fd); |
|||
#endif |
|||
#if WITH_HELP |
|||
fputs(" -?|-h print this help text\n", fd); |
|||
fputs(" -d increase verbosity (use up to 4 times)\n", fd); |
|||
#endif |
|||
#if 0 |
|||
fputs(" -ly[facility] log to syslog, using facility (default is daemon)\n", fd); |
|||
fputs(" -lf<logfile> log to file\n", fd); |
|||
fputs(" -ls log to stderr (default if no other log)\n", fd); |
|||
#endif |
|||
fputs(" -i<fdnum> only analyze this fd\n", fd); |
|||
fprintf(fd, " -n<fdnum> analyze all fds from 0 up to fdnum-1 (default: %u)\n", FD_SETSIZE); |
|||
fputs(" -s simple output with just type and socket address or path\n", fd); |
|||
/* fputs(" -c alternate device visualization\n", fd);*/ |
|||
fputs(" -f<filename> analyze file system entry\n", fd); |
|||
fputs(" -T<seconds> wait before analyzing, useful to connect with debugger\n", fd); |
|||
fputs(" -r raw output for time stamps and rdev\n", fd); |
|||
fputs(" -L follow symbolic links instead of showing their properties\n", fd); |
|||
fputs(" -o<filename> output goes to filename, that can be:\n", fd); |
|||
fputs(" a regular file name, the output goes to that\n", fd); |
|||
fputs(" +<filedes> , output goes to the file descriptor (which must be open writable)\n", fd); |
|||
fputs(" the 3 special names stdin stdout and stderr\n", fd); |
|||
} |
|||
#endif /* WITH_HELP */ |
|||
@ -0,0 +1,158 @@ |
|||
#! /bin/sh |
|||
# source: ftp.sh |
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES) |
|||
# Published under the GNU General Public License V.2, see file COPYING |
|||
|
|||
# example how to write a shell script that communicates with stdio on the front |
|||
# end and with a socat address on the back end |
|||
|
|||
# usage: |
|||
# ftp.sh [opts] server directory/ # show directory contents on stdout |
|||
# ftp.sh [opts] server file # print file contents to stdout |
|||
# opts: |
|||
# -socks socksserver # use given socks server, port 1080 |
|||
# -proxy proxyserver # use given proxy server, port 8080 |
|||
# # must be http proxy that accepts CONNECT |
|||
# # method to ports 21 and >=1024 |
|||
# -user username # default: "ftp" |
|||
# -passwd password # default: "anonymous@domain.org" |
|||
# -t # shell script trace+debug |
|||
# -d # debug on control connection (use up to 4 times) |
|||
# -D # debug on data connection (use up to 4 times) |
|||
# -b # block size for data connection |
|||
# -v # verbose |
|||
# -l* # socat logging options |
|||
# example: |
|||
# ftp.sh -v -d -d -D -D -D -b 65536 -proxy proxy ftp.ftp.org /README >README |
|||
|
|||
user="ftp" |
|||
passwd="anonymous@domain.org" |
|||
#method="socks4:socks" # socks4 is address spec, socks is socks server name |
|||
method=tcp |
|||
addropts= |
|||
|
|||
# socat options |
|||
SO1= |
|||
SO2= |
|||
|
|||
while :; do |
|||
case "$1" in |
|||
-socks|-socks4) shift; |
|||
case "$1" in |
|||
*:*) method="socks4:${1%%:*}"; addropts="socksport=${1#*:}" ;; |
|||
*) method="socks4:$1" ;; |
|||
esac ;; |
|||
-socks4a) shift; |
|||
case "$1" in |
|||
*:*) method="socks4a:${1%%:*}"; addropts="socksport=${1#*:}" ;; |
|||
*) method="socks4a:$1" ;; |
|||
esac ;; |
|||
-proxy) shift; |
|||
case "$1" in |
|||
*:*) method="proxy:${1%%:*}"; addropts="proxyport=${1#*:}" ;; |
|||
*) method="proxy:$1" ;; |
|||
esac ;; |
|||
-user) shift; user="$1" ;; |
|||
-passwd) shift; passwd="$1" ;; |
|||
-t) set -vx ;; |
|||
-d) SO1="$SO1 -d" ;; |
|||
-D) SO2="$SO2 -d" ;; |
|||
-b) SO2="$SO2 -b $2"; shift ;; |
|||
-v) SO1="$SO1 -v" ;; |
|||
-l*) SO1="$SO1 $1"; SO2="$SO2 $1" ;; |
|||
-*) echo "unknown option \"$1\"" >&2; exit 1;; |
|||
*) break ;; |
|||
esac |
|||
shift |
|||
done |
|||
export SO2 |
|||
|
|||
server="$1" |
|||
dir="$2" |
|||
|
|||
echo "addr=$method:$server:21,$addropts"; exit |
|||
|
|||
### this is the central part to establish communication with socat ### |
|||
### copy these lines to make new communication shell scripts |
|||
TMPDIR=$(if [ -x /bin/mktemp ]; then |
|||
/bin/mktemp -d /tmp/$USER/FTPSH.XXXXXX |
|||
else |
|||
(umask 077; d=/tmp/$USER/FTPSH.$$; mkdir $d; echo $d) |
|||
fi) |
|||
TO="$TMPDIR/to"; FROM="$TMPDIR/from" |
|||
socat $SO1 fifo:$TO,nonblock,ignoreeof!!fifo:$FROM $method:$server:21,$addropts & |
|||
S1=$! |
|||
while ! [ -p "$TO" -a -p "$FROM" ]; do sleep 1; done |
|||
exec 4>$TMPDIR/to 3<$TMPDIR/from |
|||
trap "S1=" 17 |
|||
#trap "echo cleaning up...>&2; rm -r $TMPDIR; [ -n "$S1" ] && kill $S1" 0 3 |
|||
trap "rm -r $TMPDIR" 0 3 |
|||
### here the central part ends |
|||
|
|||
|
|||
# this function waits for a complete server message, checks if its status |
|||
# is in the permitted range (terminates session if not), and returns. |
|||
ftp_chat () { |
|||
local cmd="$1" |
|||
local errlevel="$2"; [ -z "$errlevel" ] && errlevel=300 |
|||
if [ -n "$cmd" ]; then echo "$cmd" >&4; fi |
|||
while read status message <&3; |
|||
( case "$status" in [0-9][0-9][0-9]-*) exit 0;; [0-9][0-9][0-9]*) exit 1;; *) exit 1;; esac ) |
|||
do :; done |
|||
#echo "got \"$status $message\"" >&2 |
|||
if [ -z "$status" ]; then echo ftp data connection failed >&2; exit; fi |
|||
if [ "$status" -ge "$errlevel" ]; then |
|||
echo $message >&2 |
|||
echo "QUIT" >&4; exit 1 |
|||
fi |
|||
set +vx |
|||
} |
|||
|
|||
|
|||
# wait for server greeting |
|||
ftp_chat |
|||
|
|||
ftp_chat "USER $user" 400 |
|||
|
|||
ftp_chat "PASS $passwd" |
|||
|
|||
#ftp_chat "CWD $dir" |
|||
|
|||
case "$dir" in |
|||
*/) ftp_chat "TYPE A" ;; |
|||
*) ftp_chat "TYPE I" ;; |
|||
esac |
|||
|
|||
echo "PASV" >&4; read status message <&3 |
|||
info=$(expr "$message" : '.*[^0-9]\([0-9]*,[0-9]*,[0-9]*,[0-9]*,[0-9]*,[0-9]*\).*') |
|||
echo $info |tr ',' ' ' |(read i1 i2 i3 i4 p1 p2 |
|||
|
|||
addr=$i1.$i2.$i3.$i4 |
|||
port=$(echo "256*$p1+$p2" |bc) |
|||
#echo $addr:$port |
|||
|
|||
trap : 20 |
|||
# open data connection and transfer data |
|||
socat -u $SO2 $method:$server:$port,$addropts - |
|||
) & |
|||
S2=$! |
|||
|
|||
case "$dir" in |
|||
*/) ftp_chat "NLST $dir" ;; |
|||
#*/) ftp_chat "LIST $dir" ;; |
|||
*) ftp_chat "RETR $dir" ;; |
|||
esac |
|||
case "$status" in |
|||
[45]*) kill $S2;; |
|||
esac |
|||
|
|||
#echo "waiting for process $S2 to terminate" >&2 |
|||
wait $S2 |
|||
|
|||
ftp_chat |
|||
|
|||
ftp_chat "QUIT" |
|||
|
|||
#echo "waiting for process $S1 to terminate" >&2 |
|||
wait $S1 |
|||
exit |
|||
@ -0,0 +1,172 @@ |
|||
#! /bin/sh |
|||
# source: gatherinfo.sh |
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES) |
|||
# Published under the GNU General Public License V.2, see file COPYING |
|||
|
|||
#set -vx |
|||
|
|||
# use this script after successful porting |
|||
# provide the platform name as argument with no dots, e.g. HPUX-11-0 |
|||
# it generates the files: |
|||
# Config/Makefile.PLATFORM |
|||
# Config/config.PLATFORM.h |
|||
# Config/socat.PLATFORM.out |
|||
# |
|||
# Config/config.PLATFORM.log |
|||
# Config/compile.PLATFORM.log |
|||
# Config/test.PLATFORM.log |
|||
|
|||
VERBOSE= |
|||
LOGGING= |
|||
INTERACTIVE= |
|||
CONFOPTS= |
|||
PLATFORM= |
|||
OUTPUT='>/dev/null' |
|||
|
|||
# how to echo special characters? |
|||
if [ `echo "x\c"` = "x" ]; then E="" |
|||
elif [ `echo -e "x\c"` = "x" ]; then E="-e" |
|||
fi |
|||
|
|||
while [ -n "$1" ]; do |
|||
case "$1" in |
|||
-v) VERBOSE=1; shift;; # tell about progress |
|||
-d) LOGGING=1; shift;; # show complete output |
|||
-i) INTERACTIVE=1; shift;; # diff and ask before overriding old files |
|||
-*) CONFOPTS="$CONFOPTS $1"; shift;; |
|||
*) PLATFORM="$1"; break;; |
|||
esac |
|||
done |
|||
|
|||
#if [ -z "$PLATFORM" ]; then |
|||
# echo "please specify a configuration name, e.g. `uname -s`-`uname -r|tr '.' '-'`!" >&2; exit 1; |
|||
#fi |
|||
|
|||
if [ $# -eq 0 ]; then |
|||
echo $E "usage: $0 [-v] [-i] [configure options ...] platform" >&2 |
|||
echo $E "\t-v\t\tverbose (print actual command)" >&2 |
|||
echo $E "\t-d\t\tdump command outputs" >&2 |
|||
echo $E "\t-i\t\tinteractive (ask before overwriting something)" >&2 |
|||
echo $E "\tconfigure options\toptions for configure script, e.g. --disable-ip6" >&2 |
|||
echo $E "\tplatform\tdescribe your OS, e.g. `uname -s`-`uname -r|tr '.' '-'`" >&2 |
|||
exit 1 |
|||
fi |
|||
|
|||
case "$PLATFORM" in |
|||
*.*) echo "platform name must not contain '.'" >&2; exit 1;; |
|||
esac |
|||
|
|||
|
|||
# now, lets begin! |
|||
|
|||
if [ -f Makefile ]; then |
|||
COMMAND="make distclean" |
|||
[ "$VERBOSE" ] && echo "$COMMAND" |
|||
$COMMAND >/dev/null 2>&1 || echo "*** failed: $COMMAND" 1>&2 |
|||
fi |
|||
|
|||
# implicitly generates Makefile, config.h, config.log |
|||
COMMAND="./configure $CONFOPTS" |
|||
LOGFILE="compile.log" |
|||
[ "$VERBOSE" ] && echo "$COMMAND" |
|||
if [ "$LOGGING" ]; then |
|||
{ $COMMAND; echo "$?" >socat.rc; } 2>&1 |tee $LOGFILE; |
|||
if [ `cat socat.rc` -ne 0 ]; then echo "*** failed: $COMMAND" 1>&2; exit 1; fi |
|||
else |
|||
$COMMAND >$LOGFILE 2>&1 || { echo "*** failed: $COMMAND" 1>&2; exit 1; } |
|||
fi |
|||
|
|||
COMMAND="make -k" |
|||
LOGFILE="compile.log" |
|||
[ "$VERBOSE" ] && echo "$COMMAND" |
|||
if [ "$LOGGING" ]; then |
|||
{ $COMMAND; echo "$?" >socat.rc; } 2>&1 |tee -a $LOGFILE; |
|||
if [ `cat socat.rc` -ne 0 ]; then echo "*** failed: $COMMAND" 1>&2; exit 1; fi |
|||
else |
|||
$COMMAND >>$LOGFILE 2>&1 || { echo "*** failed: $COMMAND" 1>&2; exit 1; } |
|||
fi |
|||
|
|||
# generates socat.out |
|||
COMMAND="make info" |
|||
[ "$VERBOSE" ] && echo "$COMMAND" |
|||
$COMMAND >/dev/null || echo "*** failed: $COMMAND" 1>&2 |
|||
|
|||
COMMAND="./test.sh" |
|||
LOGFILE="test.log" |
|||
[ "$VERBOSE" ] && echo "$COMMAND" |
|||
if [ "$LOGGING" ]; then |
|||
{ $COMMAND; echo "$?" >socat.rc; } 2>&1 |tee $LOGFILE; |
|||
if [ `cat socat.rc` -ne 0 ]; then |
|||
echo "*** failed: $COMMAND" 1>&2 |
|||
if [ `cat socat.rc` -ge 128 ]; then |
|||
exit 1 |
|||
fi |
|||
fi |
|||
else |
|||
$COMMAND >$LOGFILE 2>&1 || echo "*** failed: $COMMAND" 1>&2 |
|||
fi |
|||
|
|||
FILES= |
|||
|
|||
b=Makefile; e=; f=$b; p=Config/$b.$PLATFORM |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$p" |
|||
|
|||
b=config; e=h; f=$b.$e; p=Config/$b.$PLATFORM.$e |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$FILES $p" |
|||
|
|||
b=socat; e=out; f=$b.$e; p=Config/$b.$PLATFORM.$e |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$FILES $p" |
|||
|
|||
b=config; e=log; f=$b.$e; p=Config/$b.$PLATFORM.$e |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$FILES $p" |
|||
|
|||
b=compile; e=log; f=$b.$e; p=Config/$b.$PLATFORM.$e |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$FILES $p" |
|||
|
|||
b=test; e=log; f=$b.$e; p=Config/$b.$PLATFORM.$e |
|||
if [ "$INTERACTIVE" -a -f $p ]; then |
|||
if ! diff $p $f; then |
|||
cp -pi $f $p |
|||
fi |
|||
else |
|||
cp -p $f $p |
|||
fi |
|||
FILES="$FILES $p" |
|||
|
|||
echo "output files:" |
|||
echo "$FILES" |
|||
@ -0,0 +1,103 @@ |
|||
/* source: hostan.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* the subroutine hostan makes a "HOST ANalysis". It gathers information |
|||
about the host environment it is running in without modifying its state |
|||
(almost). |
|||
*/ |
|||
|
|||
#include "xiosysincludes.h" |
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
#include "sysutils.h" |
|||
#include "filan.h" |
|||
|
|||
#include "hostan.h" |
|||
|
|||
|
|||
static int iffan(FILE *outfile); |
|||
|
|||
int hostan(FILE *outfile) { |
|||
fprintf(outfile, "\nC TYPE SIZES\n"); |
|||
fprintf(outfile, "sizeof(char) = %u\n", (unsigned int)sizeof(char)); |
|||
fprintf(outfile, "sizeof(short) = %u\n", (unsigned int)sizeof(short)); |
|||
fprintf(outfile, "sizeof(int) = %u\n", (unsigned int)sizeof(int)); |
|||
fprintf(outfile, "sizeof(long) = %u\n", (unsigned int)sizeof(long)); |
|||
#if HAVE_TYPE_LONGLONG |
|||
fprintf(outfile, "sizeof(long long) = %u\n", (unsigned int)sizeof(long long)); |
|||
#endif |
|||
fprintf(outfile, "sizeof(size_t) = %u\n", (unsigned int)sizeof(size_t)); |
|||
#include <sys/time.h> /* select(); OpenBSD: struct timespec */ |
|||
fprintf(outfile, "sizeof(struct timespec) = %u\n", (unsigned int)sizeof(struct timespec)); |
|||
fprintf(outfile, "sizeof(struct diag_dgram) = %u\n", (unsigned int)sizeof(struct diag_dgram)); |
|||
fprintf(outfile, "((struct diag_dgram *)0)->op-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->op)-(char *)((struct diag_dgram *)0))); |
|||
fprintf(outfile, "((struct diag_dgram *)0)->now-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->now)-(char *)((struct diag_dgram *)0))); |
|||
fprintf(outfile, "((struct diag_dgram *)0)->exitcode-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->exitcode)-(char *)((struct diag_dgram *)0))); |
|||
fprintf(outfile, "((struct diag_dgram *)0)->text-((struct diag_dgram *)0) = %u\n", (unsigned int)((((struct diag_dgram *)0)->text)-(char *)((struct diag_dgram *)0))); |
|||
#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) |
|||
fprintf(outfile, "\nIP INTERFACES\n"); |
|||
iffan(outfile); |
|||
#endif |
|||
return 0; |
|||
} |
|||
|
|||
#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) |
|||
static int iffan(FILE *outfile) { |
|||
/* Linux: man 7 netdevice */ |
|||
/* FreeBSD, NetBSD: man 4 networking */ |
|||
/* Solaris: man 7 if_tcp */ |
|||
|
|||
/* currently we support Linux and a little FreeBSD */ |
|||
#ifdef SIOCGIFCONF /* not Solaris */ |
|||
|
|||
#define IFBUFSIZ 32*sizeof(struct ifreq) /*1024*/ |
|||
int s; |
|||
unsigned char buff[IFBUFSIZ]; |
|||
struct ifconf ic; |
|||
int i; |
|||
|
|||
if ((s = Socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) { |
|||
Error1("socket(PF_INET, SOCK_DGRAM, IPPROTO_IP): %s", strerror(errno)); |
|||
return -1; |
|||
} |
|||
|
|||
for (i=0; i < IFBUFSIZ; ++i) { |
|||
buff[i] = 255; |
|||
} |
|||
ic.ifc_len = sizeof(buff); |
|||
ic.ifc_ifcu.ifcu_buf = (caddr_t)buff; |
|||
if (Ioctl(s, SIOCGIFCONF, &ic) < 0) { |
|||
Error3("ioctl(%d, SIOCGIFCONF, %p): %s", s, &ic, strerror(errno)); |
|||
return -1; |
|||
} |
|||
|
|||
for (i = 0; i < ic.ifc_len; i += sizeof(struct ifreq)) { |
|||
struct ifreq *ifp = (struct ifreq *)((caddr_t)ic.ifc_req + i); |
|||
#if 0 || defined(SIOCGIFINDEX) /* not NetBSD, OpenBSD */ |
|||
struct ifreq ifr; |
|||
#endif |
|||
|
|||
#if 0 || defined(SIOCGIFINDEX) /* not NetBSD, OpenBSD */ |
|||
strcpy(ifr.ifr_name, ifp->ifr_name); |
|||
if (Ioctl(s, SIOCGIFINDEX, &ifr) < 0) { |
|||
Error3("ioctl(%d, SIOCGIFINDEX, {\"%s\"}): %s", |
|||
s, ifr.ifr_name, strerror(errno)); |
|||
return 1; |
|||
} |
|||
#if HAVE_STRUCT_IFREQ_IFR_INDEX |
|||
fprintf(outfile, "%2d: %s\n", ifr.ifr_index, ifp->ifr_name); |
|||
#elif HAVE_STRUCT_IFREQ_IFR_IFINDEX |
|||
fprintf(outfile, "%2d: %s\n", ifr.ifr_ifindex, ifp->ifr_name); |
|||
#endif /* HAVE_STRUCT_IFREQ_IFR_INDEX */ |
|||
#else /* !defined(SIOCGIFINDEX) */ |
|||
fprintf(outfile, "%2d: %s\n", i/(int)sizeof(struct ifreq), ifp->ifr_name); |
|||
#endif /* defined(SIOCGIFINDEX) */ |
|||
} |
|||
Close(s); |
|||
#endif /* defined(SIOCGIFCONF) */ |
|||
return 0; |
|||
} |
|||
#endif /* _WITH_SOCKET */ |
|||
@ -0,0 +1,10 @@ |
|||
/* source: hostan.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __hostan_h_included |
|||
#define __hostan_h_included 1 |
|||
|
|||
extern int hostan(FILE *outfile); |
|||
|
|||
#endif /* !defined(__hostan_h_included) */ |
|||
@ -0,0 +1,250 @@ |
|||
#! /bin/sh |
|||
# |
|||
# install - install a program, script, or datafile |
|||
# This comes from X11R5 (mit/util/scripts/install.sh). |
|||
# |
|||
# Copyright 1991 by the Massachusetts Institute of Technology |
|||
# |
|||
# Permission to use, copy, modify, distribute, and sell this software and its |
|||
# documentation for any purpose is hereby granted without fee, provided that |
|||
# the above copyright notice appear in all copies and that both that |
|||
# copyright notice and this permission notice appear in supporting |
|||
# documentation, and that the name of M.I.T. not be used in advertising or |
|||
# publicity pertaining to distribution of the software without specific, |
|||
# written prior permission. M.I.T. makes no representations about the |
|||
# suitability of this software for any purpose. It is provided "as is" |
|||
# without express or implied warranty. |
|||
# |
|||
# Calling this script install-sh is preferred over install.sh, to prevent |
|||
# `make' implicit rules from creating a file called install from it |
|||
# when there is no Makefile. |
|||
# |
|||
# This script is compatible with the BSD install script, but was written |
|||
# from scratch. It can only install one file at a time, a restriction |
|||
# shared with many OS's install programs. |
|||
|
|||
|
|||
# set DOITPROG to echo to test this script |
|||
|
|||
# Don't use :- since 4.3BSD and earlier shells don't like it. |
|||
doit="${DOITPROG-}" |
|||
|
|||
|
|||
# put in absolute paths if you don't have them in your path; or use env. vars. |
|||
|
|||
mvprog="${MVPROG-mv}" |
|||
cpprog="${CPPROG-cp}" |
|||
chmodprog="${CHMODPROG-chmod}" |
|||
chownprog="${CHOWNPROG-chown}" |
|||
chgrpprog="${CHGRPPROG-chgrp}" |
|||
stripprog="${STRIPPROG-strip}" |
|||
rmprog="${RMPROG-rm}" |
|||
mkdirprog="${MKDIRPROG-mkdir}" |
|||
|
|||
transformbasename="" |
|||
transform_arg="" |
|||
instcmd="$mvprog" |
|||
chmodcmd="$chmodprog 0755" |
|||
chowncmd="" |
|||
chgrpcmd="" |
|||
stripcmd="" |
|||
rmcmd="$rmprog -f" |
|||
mvcmd="$mvprog" |
|||
src="" |
|||
dst="" |
|||
dir_arg="" |
|||
|
|||
while [ x"$1" != x ]; do |
|||
case $1 in |
|||
-c) instcmd="$cpprog" |
|||
shift |
|||
continue;; |
|||
|
|||
-d) dir_arg=true |
|||
shift |
|||
continue;; |
|||
|
|||
-m) chmodcmd="$chmodprog $2" |
|||
shift |
|||
shift |
|||
continue;; |
|||
|
|||
-o) chowncmd="$chownprog $2" |
|||
shift |
|||
shift |
|||
continue;; |
|||
|
|||
-g) chgrpcmd="$chgrpprog $2" |
|||
shift |
|||
shift |
|||
continue;; |
|||
|
|||
-s) stripcmd="$stripprog" |
|||
shift |
|||
continue;; |
|||
|
|||
-t=*) transformarg=`echo $1 | sed 's/-t=//'` |
|||
shift |
|||
continue;; |
|||
|
|||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'` |
|||
shift |
|||
continue;; |
|||
|
|||
*) if [ x"$src" = x ] |
|||
then |
|||
src=$1 |
|||
else |
|||
# this colon is to work around a 386BSD /bin/sh bug |
|||
: |
|||
dst=$1 |
|||
fi |
|||
shift |
|||
continue;; |
|||
esac |
|||
done |
|||
|
|||
if [ x"$src" = x ] |
|||
then |
|||
echo "install: no input file specified" |
|||
exit 1 |
|||
else |
|||
true |
|||
fi |
|||
|
|||
if [ x"$dir_arg" != x ]; then |
|||
dst=$src |
|||
src="" |
|||
|
|||
if [ -d $dst ]; then |
|||
instcmd=: |
|||
else |
|||
instcmd=mkdir |
|||
fi |
|||
else |
|||
|
|||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command |
|||
# might cause directories to be created, which would be especially bad |
|||
# if $src (and thus $dsttmp) contains '*'. |
|||
|
|||
if [ -f $src -o -d $src ] |
|||
then |
|||
true |
|||
else |
|||
echo "install: $src does not exist" |
|||
exit 1 |
|||
fi |
|||
|
|||
if [ x"$dst" = x ] |
|||
then |
|||
echo "install: no destination specified" |
|||
exit 1 |
|||
else |
|||
true |
|||
fi |
|||
|
|||
# If destination is a directory, append the input filename; if your system |
|||
# does not like double slashes in filenames, you may need to add some logic |
|||
|
|||
if [ -d $dst ] |
|||
then |
|||
dst="$dst"/`basename $src` |
|||
else |
|||
true |
|||
fi |
|||
fi |
|||
|
|||
## this sed command emulates the dirname command |
|||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` |
|||
|
|||
# Make sure that the destination directory exists. |
|||
# this part is taken from Noah Friedman's mkinstalldirs script |
|||
|
|||
# Skip lots of stat calls in the usual case. |
|||
if [ ! -d "$dstdir" ]; then |
|||
defaultIFS=' |
|||
' |
|||
IFS="${IFS-${defaultIFS}}" |
|||
|
|||
oIFS="${IFS}" |
|||
# Some sh's can't handle IFS=/ for some reason. |
|||
IFS='%' |
|||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` |
|||
IFS="${oIFS}" |
|||
|
|||
pathcomp='' |
|||
|
|||
while [ $# -ne 0 ] ; do |
|||
pathcomp="${pathcomp}${1}" |
|||
shift |
|||
|
|||
if [ ! -d "${pathcomp}" ] ; |
|||
then |
|||
$mkdirprog "${pathcomp}" |
|||
else |
|||
true |
|||
fi |
|||
|
|||
pathcomp="${pathcomp}/" |
|||
done |
|||
fi |
|||
|
|||
if [ x"$dir_arg" != x ] |
|||
then |
|||
$doit $instcmd $dst && |
|||
|
|||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && |
|||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && |
|||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && |
|||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi |
|||
else |
|||
|
|||
# If we're going to rename the final executable, determine the name now. |
|||
|
|||
if [ x"$transformarg" = x ] |
|||
then |
|||
dstfile=`basename $dst` |
|||
else |
|||
dstfile=`basename $dst $transformbasename | |
|||
sed $transformarg`$transformbasename |
|||
fi |
|||
|
|||
# don't allow the sed command to completely eliminate the filename |
|||
|
|||
if [ x"$dstfile" = x ] |
|||
then |
|||
dstfile=`basename $dst` |
|||
else |
|||
true |
|||
fi |
|||
|
|||
# Make a temp file name in the proper directory. |
|||
|
|||
dsttmp=$dstdir/#inst.$$# |
|||
|
|||
# Move or copy the file name to the temp name |
|||
|
|||
$doit $instcmd $src $dsttmp && |
|||
|
|||
trap "rm -f ${dsttmp}" 0 && |
|||
|
|||
# and set any options; do chmod last to preserve setuid bits |
|||
|
|||
# If any of these fail, we abort the whole thing. If we want to |
|||
# ignore errors from any of these, just make sure not to ignore |
|||
# errors from the above "$doit $instcmd $src $dsttmp" command. |
|||
|
|||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && |
|||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && |
|||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && |
|||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && |
|||
|
|||
# Now rename the file to the real destination. |
|||
|
|||
$doit $rmcmd -f $dstdir/$dstfile && |
|||
$doit $mvcmd $dsttmp $dstdir/$dstfile |
|||
|
|||
fi && |
|||
|
|||
|
|||
exit 0 |
|||
@ -0,0 +1,73 @@ |
|||
#! /bin/sh |
|||
# source: mail.sh |
|||
# Copyright Gerhard Rieger and contributors (see file CHANGES) |
|||
# Published under the GNU General Public License V.2, see file COPYING |
|||
|
|||
#set -vx |
|||
|
|||
# This is an example for a shell script that can be fed to socat with exec. |
|||
# Its clue is that it does not use stdin/stdout for communication with socat, |
|||
# so you may feed the mail message via stdin to the script. The message should |
|||
# contain appropriate mail headers without continuation lines. |
|||
# socat establishes the connection to the SMTP server; the script performs the |
|||
# SMTP dialog and afterwards transfers the message body to the server. |
|||
# Lines with only a dot are not permitted - use two dots as escape. |
|||
# This script supports multiline answers from server, but not much more yet. |
|||
|
|||
# Usage: cat message.txt |socat exec:"mail.sh target@domain.com",fdin=3,fdout=4 tcp:mail.relay.org:25,crlf |
|||
|
|||
while [ "$1" ]; do |
|||
case "$1" in |
|||
-f) shift; mailfrom="$1"; shift;; |
|||
*) break;; |
|||
esac |
|||
done |
|||
|
|||
rcptto="$1" |
|||
[ -z "$1" ] && rcptto="root@loopback" |
|||
#server=$(expr "$rcptto" : '[^@]*@\(.*\)') |
|||
[ -z "$mailfrom" ] && mailfrom="$USER@$(hostname)" |
|||
|
|||
# this function waits for a complete server message, checks if its status |
|||
# is in the permitted range (terminates session if not), and returns. |
|||
mail_chat () { |
|||
local cmd="$1" |
|||
local errlevel="$2"; [ -z "$errlevel" ] && errlevel=300 |
|||
|
|||
if [ "$cmd" ]; then echo "> $cmd" >&2; fi |
|||
if [ -n "$cmd" ]; then echo "$cmd" >&4; fi |
|||
while read status message <&3; |
|||
( |
|||
case "$status" in |
|||
[0-9][0-9][0-9]-*) exit 0;; |
|||
[0-9][0-9][0-9]*) exit 1;; |
|||
*) exit 1;; |
|||
esac |
|||
) |
|||
do :; done |
|||
if [ -z "$status" ]; then echo smtp connection failed >&2; exit; fi |
|||
echo "< $status $message" >&2 |
|||
if [ "$status" -ge "$errlevel" ]; then |
|||
echo $message >&2 |
|||
echo "QUIT" >&4; exit 1 |
|||
fi |
|||
} |
|||
|
|||
|
|||
# expect server greeting |
|||
mail_chat |
|||
|
|||
mail_chat "HELO $(hostname)" |
|||
|
|||
mail_chat "MAIL FROM: $mailfrom" |
|||
|
|||
mail_chat "RCPT TO: $rcptto" |
|||
|
|||
mail_chat "DATA" 400 |
|||
|
|||
while read l; do echo "$l" >&4; done |
|||
mail_chat "." |
|||
|
|||
mail_chat "QUIT" |
|||
|
|||
exit 0 |
|||
@ -0,0 +1,25 @@ |
|||
/* source: mytypes.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __mytypes_h_included |
|||
#define __mytypes_h_included 1 |
|||
|
|||
/* some types and macros I miss in C89 */ |
|||
|
|||
#ifndef HAVE_TYPE_BOOL |
|||
# undef bool |
|||
typedef enum { false, true } bool; |
|||
#endif |
|||
|
|||
#ifndef Min |
|||
#define Min(x,y) ((x)<=(y)?(x):(y)) |
|||
#endif |
|||
|
|||
#ifndef Max |
|||
#define Max(x,y) ((x)>=(y)?(x):(y)) |
|||
#endif |
|||
|
|||
#define SOCKADDR_MAX UNIX_PATH_MAX |
|||
|
|||
#endif /* __mytypes_h_included */ |
|||
@ -0,0 +1,270 @@ |
|||
/* source: nestlex.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* a function for lexical scanning of nested character patterns */ |
|||
|
|||
#include "config.h" |
|||
#include "mytypes.h" |
|||
|
|||
#include "sysincludes.h" |
|||
|
|||
static int _nestlex(const char **addr, |
|||
char **token, |
|||
ptrdiff_t *len, |
|||
const char *ends[], |
|||
const char *hquotes[], |
|||
const char *squotes[], |
|||
const char *nests[], |
|||
bool dropquotes, |
|||
bool c_esc, |
|||
bool html_esc |
|||
); |
|||
|
|||
/* sub: scan a string and copy its value to output string |
|||
end scanning when an unescaped, unnested string from ends array is found |
|||
does not copy the end pattern |
|||
does not write a trailing \0 to token |
|||
allows escaping with \ and quoting (\ and quotes are removed) |
|||
allows nesting with div. parens |
|||
returns -1 if out string was too small |
|||
returns 1 if addr ended unexpectedly |
|||
returns 0 if token could be extracted successfully |
|||
*/ |
|||
int nestlex(const char **addr, /* input string; aft points to end token */ |
|||
char **token, /* output token; aft points to first unwritten |
|||
char (caller might want to set it to \0) */ |
|||
size_t *len, /* remaining bytes in token space (incl. \0) */ |
|||
const char *ends[], /* list of end strings */ |
|||
const char *hquotes[],/* list of strings that quote (hard qu.) */ |
|||
const char *squotes[],/* list of strings that quote softly */ |
|||
const char *nests[],/* list of strings that start nesting; |
|||
every second one is matching end */ |
|||
bool dropquotes, /* drop the outermost quotes */ |
|||
bool c_esc, /* solve C char escapes: \n \t \0 etc */ |
|||
bool html_esc /* solve HTML char escapes: %0d %08 etc */ |
|||
) { |
|||
return |
|||
_nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests, |
|||
dropquotes, c_esc, html_esc); |
|||
} |
|||
|
|||
static int _nestlex(const char **addr, |
|||
char **token, |
|||
ptrdiff_t *len, |
|||
const char *ends[], |
|||
const char *hquotes[], |
|||
const char *squotes[], |
|||
const char *nests[], |
|||
bool dropquotes, |
|||
bool c_esc, |
|||
bool html_esc |
|||
) { |
|||
const char *in = *addr; /* pointer into input string */ |
|||
const char **endx; /* loops over end patterns */ |
|||
const char **quotx; /* loops over quote patterns */ |
|||
const char **nestx; /* loops over nest patterns */ |
|||
char *out = *token; /* pointer into output token */ |
|||
char c; |
|||
int i; |
|||
int result; |
|||
|
|||
while (true) { |
|||
|
|||
/* is this end of input string? */ |
|||
if (*in == 0) { |
|||
|
|||
break; /* end of string */ |
|||
} |
|||
|
|||
/* first check the end patterns (e.g. for ']') */ |
|||
endx = ends; i = 0; |
|||
while (*endx) { |
|||
if (!strncmp(in, *endx, strlen(*endx))) { |
|||
/* this end pattern matches */ |
|||
*addr = in; |
|||
*token = out; |
|||
return 0; |
|||
} |
|||
++endx; |
|||
} |
|||
|
|||
/* check for hard quoting pattern */ |
|||
quotx = hquotes; |
|||
while (hquotes && *quotx) { |
|||
if (!strncmp(in, *quotx, strlen(*quotx))) { |
|||
/* this quote pattern matches */ |
|||
const char *endnest[2]; |
|||
if (dropquotes) { |
|||
/* we strip this quote */ |
|||
in += strlen(*quotx); |
|||
} else { |
|||
for (i = strlen(*quotx); i > 0; --i) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { *addr = in; *token = out; return -1; } |
|||
} |
|||
} |
|||
/* we call _nestlex recursively */ |
|||
endnest[0] = *quotx; |
|||
endnest[1] = NULL; |
|||
result = |
|||
_nestlex(&in, &out, len, endnest, NULL/*hquotes*/, |
|||
NULL/*squotes*/, NULL/*nests*/, |
|||
false, c_esc, html_esc); |
|||
if (result == 0 && dropquotes) { |
|||
/* we strip this quote */ |
|||
in += strlen(*quotx); |
|||
} else if (result < 0) { |
|||
*addr = in; *token = out; return result; |
|||
} else { |
|||
/* we copy the trailing quote */ |
|||
for (i = strlen(*quotx); i > 0; --i) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { *addr = in; *token = out; return -1; } |
|||
} |
|||
} |
|||
|
|||
break; |
|||
} |
|||
++quotx; |
|||
} |
|||
if (hquotes && *quotx != NULL) { |
|||
/* there was a quote; string might continue with hard quote */ |
|||
continue; |
|||
} |
|||
|
|||
/* check for soft quoting pattern */ |
|||
quotx = squotes; |
|||
while (squotes && *quotx) { |
|||
if (!strncmp(in, *quotx, strlen(*quotx))) { |
|||
/* this quote pattern matches */ |
|||
/* we strip this quote */ |
|||
/* we call _nestlex recursively */ |
|||
const char *endnest[2]; |
|||
if (dropquotes) { |
|||
/* we strip this quote */ |
|||
in += strlen(*quotx); |
|||
} else { |
|||
for (i = strlen(*quotx); i > 0; --i) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { *addr = in; *token = out; return -1; } |
|||
} |
|||
} |
|||
endnest[0] = *quotx; |
|||
endnest[1] = NULL; |
|||
result = |
|||
_nestlex(&in, &out, len, endnest, hquotes, |
|||
squotes, nests, |
|||
false, c_esc, html_esc); |
|||
|
|||
if (result == 0 && dropquotes) { |
|||
/* we strip the trailing quote */ |
|||
in += strlen(*quotx); |
|||
} else if (result < 0) { |
|||
*addr = in; *token = out; return result; |
|||
} else { |
|||
/* we copy the trailing quote */ |
|||
for (i = strlen(*quotx); i > 0; --i) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { *addr = in; *token = out; return -1; } |
|||
} |
|||
} |
|||
break; |
|||
} |
|||
++quotx; |
|||
} |
|||
if (squotes && *quotx != NULL) { |
|||
/* there was a soft quote; string might continue with any quote */ |
|||
continue; |
|||
} |
|||
|
|||
/* check patterns that start a nested clause */ |
|||
nestx = nests; i = 0; |
|||
while (nests && *nestx) { |
|||
if (!strncmp(in, *nestx, strlen(*nestx))) { |
|||
/* this nest pattern matches */ |
|||
const char *endnest[2]; |
|||
endnest[0] = nestx[1]; |
|||
endnest[1] = NULL; |
|||
|
|||
for (i = strlen(nestx[1]); i > 0; --i) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { *addr = in; *token = out; return -1; } |
|||
} |
|||
|
|||
result = |
|||
_nestlex(&in, &out, len, endnest, hquotes, squotes, nests, |
|||
false, c_esc, html_esc); |
|||
if (result == 0) { |
|||
/* copy endnest */ |
|||
i = strlen(nestx[1]); while (i > 0) { |
|||
*out++ = *in++; |
|||
if (--*len <= 0) { |
|||
*addr = in; |
|||
*token = out; |
|||
return -1; |
|||
} |
|||
--i; |
|||
} |
|||
} else if (result < 0) { |
|||
*addr = in; *token = out; return result; |
|||
} |
|||
break; |
|||
} |
|||
nestx += 2; /* skip matching end pattern in table */ |
|||
} |
|||
if (nests && *nestx) { |
|||
/* we handled a nested expression, continue loop */ |
|||
continue; |
|||
} |
|||
|
|||
/* "normal" data, possibly escaped */ |
|||
c = *in++; |
|||
if (c == '\\') { |
|||
/* found a plain \ escaped part */ |
|||
c = *in++; |
|||
if (c == 0) { /* Warn("trailing '\\'");*/ break; } |
|||
if (c_esc) { /* solve C char escapes: \n \t \0 etc */ |
|||
switch (c) { |
|||
case '0': c = '\0'; break; |
|||
case 'a': c = '\a'; break; |
|||
case 'b': c = '\b'; break; |
|||
case 'f': c = '\f'; break; |
|||
case 'n': c = '\n'; break; |
|||
case 'r': c = '\r'; break; |
|||
case 't': c = '\t'; break; |
|||
case 'v': c = '\v'; break; |
|||
#if LATER |
|||
case 'x': !!! 1 to 2 hex digits; break; |
|||
case 'u': !!! 4 hex digits?; break; |
|||
case 'U': !!! 8 hex digits?; break; |
|||
#endif |
|||
default: break; |
|||
} |
|||
} |
|||
*out++ = c; |
|||
--*len; |
|||
if (*len <= 0) { |
|||
*addr = in; |
|||
*token = out; |
|||
return -1; /* output overflow */ |
|||
} |
|||
continue; |
|||
} |
|||
|
|||
/* just a simple char */ |
|||
*out++ = c; |
|||
--*len; |
|||
if (*len <= 0) { |
|||
*addr = in; |
|||
*token = out; |
|||
return -1; /* output overflow */ |
|||
} |
|||
|
|||
} |
|||
/* never come here? */ |
|||
|
|||
*addr = in; |
|||
*token = out; |
|||
return 0; /* OK */ |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
/* source: nestlex.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __nestlex_h_included |
|||
#define __nestlex_h_included 1 |
|||
|
|||
extern |
|||
int nestlex(const char **addr, /* input string; aft points to end token */ |
|||
char **token, /* output token; aft points to first unwritten |
|||
char (caller might want to set it to \0) */ |
|||
size_t *len, /* remaining bytes in token space (incl. \0) */ |
|||
const char *ends[], /* list of end strings */ |
|||
const char *hquotes[],/* list of strings that quote (hard qu.) */ |
|||
const char *squotes[],/* list of strings that quote softly */ |
|||
const char *nests[],/* list of strings that start nesting; |
|||
every second one is matching end */ |
|||
bool dropquotes, /* drop the outermost quotes */ |
|||
bool c_esc, /* solve C char escapes: \n \t \0 etc */ |
|||
bool html_esc /* solve HTML char escapes: %0d %08 etc */ |
|||
); |
|||
|
|||
#endif /* !defined(__nestlex_h_included) */ |
|||
@ -0,0 +1,164 @@ |
|||
/* source: procan-cdefs.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* a function that prints compile time parameters */ |
|||
/* the set of parameters is only a small subset of the available defines and |
|||
will be extended on demand */ |
|||
|
|||
|
|||
#include "xiosysincludes.h" |
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
|
|||
#include "procan.h" |
|||
|
|||
int procan_cdefs(FILE *outfile) { |
|||
/* basic C/system constants */ |
|||
#ifdef FD_SETSIZE |
|||
fprintf(outfile, "#define FD_SETSIZE %u\n", FD_SETSIZE); |
|||
#endif |
|||
#ifdef NFDBITS |
|||
fprintf(outfile, "#define NFDBITS %d\n", (int)NFDBITS); |
|||
#endif |
|||
#ifdef O_RDONLY |
|||
fprintf(outfile, "#define O_RDONLY %u\n", O_RDONLY); |
|||
#endif |
|||
#ifdef O_WRONLY |
|||
fprintf(outfile, "#define O_WRONLY %u\n", O_WRONLY); |
|||
#endif |
|||
#ifdef O_RDWR |
|||
fprintf(outfile, "#define O_RDWR %u\n", O_RDWR); |
|||
#endif |
|||
#ifdef SHUT_RD |
|||
fprintf(outfile, "#define SHUT_RD %u\n", SHUT_RD); |
|||
#endif |
|||
#ifdef SHUT_WR |
|||
fprintf(outfile, "#define SHUT_WR %u\n", SHUT_WR); |
|||
#endif |
|||
#ifdef SHUT_RDWR |
|||
fprintf(outfile, "#define SHUT_RDWR %u\n", SHUT_RDWR); |
|||
#endif |
|||
|
|||
/* termios constants */ |
|||
#ifdef CRDLY |
|||
fprintf(outfile, "#define CRDLY 0%011o\n", CRDLY); |
|||
#endif |
|||
#ifdef CR0 |
|||
fprintf(outfile, "#define CR0 0%011o\n", CR0); |
|||
#endif |
|||
#ifdef CR1 |
|||
fprintf(outfile, "#define CR1 0%011o\n", CR1); |
|||
#endif |
|||
#ifdef CR2 |
|||
fprintf(outfile, "#define CR2 0%011o\n", CR2); |
|||
#endif |
|||
#ifdef CR3 |
|||
fprintf(outfile, "#define CR3 0%011o\n", CR3); |
|||
#endif |
|||
#ifdef TABDLY |
|||
fprintf(outfile, "#define TABDLY 0%011o\n", TABDLY); |
|||
#endif |
|||
#ifdef TAB0 |
|||
fprintf(outfile, "#define TAB0 0%011o\n", TAB0); |
|||
#endif |
|||
#ifdef TAB1 |
|||
fprintf(outfile, "#define TAB1 0%011o\n", TAB1); |
|||
#endif |
|||
#ifdef TAB2 |
|||
fprintf(outfile, "#define TAB2 0%011o\n", TAB2); |
|||
#endif |
|||
#ifdef TAB3 |
|||
fprintf(outfile, "#define TAB3 0%011o\n", TAB3); |
|||
#endif |
|||
#ifdef CSIZE |
|||
fprintf(outfile, "#define CSIZE 0%011o\n", CSIZE); |
|||
#endif |
|||
#ifdef TIOCEXCL |
|||
fprintf(outfile, "#define TIOCEXCL 0x%lx\n", (unsigned long)TIOCEXCL); |
|||
#endif |
|||
|
|||
/* stdio constants */ |
|||
#ifdef FOPEN_MAX |
|||
fprintf(outfile, "#define FOPEN_MAX %u\n", FOPEN_MAX); |
|||
#endif |
|||
|
|||
/* socket constants */ |
|||
#ifdef PF_UNIX |
|||
fprintf(outfile, "#define PF_UNIX %d\n", PF_UNIX); |
|||
#elif defined(PF_LOCAL) |
|||
fprintf(outfile, "#define PF_LOCAL %d\n", PF_LOCAL); |
|||
#endif |
|||
#ifdef PF_INET |
|||
fprintf(outfile, "#define PF_INET %d\n", PF_INET); |
|||
#endif |
|||
#ifdef PF_INET6 |
|||
fprintf(outfile, "#define PF_INET6 %d\n", PF_INET6); |
|||
#endif |
|||
#ifdef PF_APPLETALK |
|||
fprintf(outfile, "#define PF_APPLETALK %d\n", PF_APPLETALK); |
|||
#endif |
|||
#ifdef PF_PACKET |
|||
fprintf(outfile, "#define PF_PACKET %d\n", PF_PACKET); |
|||
#endif |
|||
#ifdef SOCK_STREAM |
|||
fprintf(outfile, "#define SOCK_STREAM %d\n", SOCK_STREAM); |
|||
#endif |
|||
#ifdef SOCK_DGRAM |
|||
fprintf(outfile, "#define SOCK_DGRAM %d\n", SOCK_DGRAM); |
|||
#endif |
|||
#ifdef SOCK_RAW |
|||
fprintf(outfile, "#define SOCK_RAW %d\n", SOCK_RAW); |
|||
#endif |
|||
#ifdef SOCK_SEQPACKET |
|||
fprintf(outfile, "#define SOCK_SEQPACKET %d\n", SOCK_SEQPACKET); |
|||
#endif |
|||
#ifdef SOCK_PACKET |
|||
fprintf(outfile, "#define SOCK_PACKET %d\n", SOCK_PACKET); |
|||
#endif |
|||
#ifdef IPPROTO_IP |
|||
fprintf(outfile, "#define IPPROTO_IP %d\n", IPPROTO_IP); |
|||
#endif |
|||
#ifdef IPPROTO_TCP |
|||
fprintf(outfile, "#define IPPROTO_TCP %d\n", IPPROTO_TCP); |
|||
#endif |
|||
#ifdef IPPROTO_UDP |
|||
fprintf(outfile, "#define IPPROTO_UDP %d\n", IPPROTO_UDP); |
|||
#endif |
|||
#ifdef IPPROTO_SCTP |
|||
fprintf(outfile, "#define IPPROTO_SCTP %d\n", IPPROTO_SCTP); |
|||
#endif |
|||
#ifdef IPPROTO_DCCP |
|||
fprintf(outfile, "#define IPPROTO_DCCP %d\n", IPPROTO_DCCP); |
|||
#endif |
|||
#ifdef SOL_SOCKET |
|||
fprintf(outfile, "#define SOL_SOCKET 0x%x\n", SOL_SOCKET); |
|||
#endif |
|||
#ifdef SOL_PACKET |
|||
fprintf(outfile, "#define SOL_PACKET 0x%x\n", SOL_PACKET); |
|||
#endif |
|||
#ifdef SOL_IP |
|||
fprintf(outfile, "#define SOL_IP 0x%x\n", SOL_IP); |
|||
#endif |
|||
#ifdef SOL_IPV6 |
|||
fprintf(outfile, "#define SOL_IPV6 0x%x\n", SOL_IPV6); |
|||
#endif |
|||
#ifdef SOL_TCP |
|||
fprintf(outfile, "#define SOL_TCP 0x%x\n", SOL_TCP); |
|||
#endif |
|||
#ifdef SOL_UDP |
|||
fprintf(outfile, "#define SOL_UDP 0x%x\n", SOL_UDP); |
|||
#endif |
|||
#ifdef SOL_SCTP |
|||
fprintf(outfile, "#define SOL_SCTP 0x%x\n", SOL_SCTP); |
|||
#endif |
|||
#ifdef SOL_DCCP |
|||
fprintf(outfile, "#define SOL_DCCP 0x%x\n", SOL_DCCP); |
|||
#endif |
|||
#ifdef SO_REUSEADDR |
|||
fprintf(outfile, "#define SO_REUSEADDR %d\n", SO_REUSEADDR); |
|||
#endif |
|||
|
|||
return 0; |
|||
} |
|||
@ -0,0 +1,169 @@ |
|||
/* source: procan.c */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
/* the subroutine procan makes a "PROCess ANalysis". It gathers information |
|||
about the process environment it is running in without modifying its state |
|||
(almost). |
|||
*/ |
|||
|
|||
#include "xiosysincludes.h" |
|||
#include "mytypes.h" |
|||
#include "compat.h" |
|||
#include "error.h" |
|||
#include "sycls.h" |
|||
#include "sysutils.h" |
|||
#include "filan.h" |
|||
|
|||
#include <sys/resource.h> |
|||
|
|||
#include "procan.h" |
|||
|
|||
/* dirty workaround so we dont get an error on AIX when getting linked with |
|||
libwrap */ |
|||
int allow_severity, deny_severity; |
|||
|
|||
|
|||
int procan(FILE *outfile) { |
|||
|
|||
/*filan(0, outfile);*/ |
|||
|
|||
/* controlling terminal */ |
|||
fprintf(outfile, "process id = "F_pid"\n", Getpid()); |
|||
fprintf(outfile, "process parent id = "F_pid"\n", Getppid()); |
|||
{ |
|||
int fd; |
|||
if ((fd = Open("/dev/tty", O_NOCTTY, 0)) < 0) { |
|||
fprintf(outfile, "controlling terminal: -\n"); |
|||
} else { |
|||
#if 1 |
|||
fprintf(outfile, "controlling terminal: \"%s\"\n", Ttyname(fd)); |
|||
#else |
|||
char procpath[PATH_MAX], devpath[PATH_MAX+1]; |
|||
int devlen; |
|||
sprintf(procpath, "/proc/"F_pid"/fd/%d", Getpid(), 0 /*! fd*/); |
|||
if ((devlen = Readlink(procpath, devpath, sizeof(devpath))) < 0) { |
|||
; |
|||
} else { |
|||
devpath[devlen] = '\0'; |
|||
fprintf(outfile, "controlling terminal: \"%s\"\n", devpath); |
|||
} |
|||
#endif |
|||
} |
|||
} |
|||
fprintf(outfile, "process group id = "F_pid"\n", Getpgrp()); |
|||
#if HAVE_GETSID |
|||
fprintf(outfile, "process session id = "F_pid"\n", Getsid(0)); |
|||
#endif |
|||
fprintf(outfile, "process group id if fg process / stdin = "F_pid"\n", Tcgetpgrp(0)); |
|||
fprintf(outfile, "process group id if fg process / stdout = "F_pid"\n", Tcgetpgrp(1)); |
|||
fprintf(outfile, "process group id if fg process / stderr = "F_pid"\n", Tcgetpgrp(2)); |
|||
{ |
|||
int fd; |
|||
if ((fd = Open("/dev/tty", O_RDWR, 0600)) >= 0) { |
|||
fprintf(outfile, "process has a controlling terminal\n"); |
|||
Close(fd); |
|||
} else { |
|||
fprintf(outfile, "process does not have a controlling terminal\n"); |
|||
} |
|||
} |
|||
|
|||
/* process owner, groups */ |
|||
fprintf(outfile, "user id = "F_uid"\n", Getuid()); |
|||
fprintf(outfile, "effective user id = "F_uid"\n", Geteuid()); |
|||
fprintf(outfile, "group id = "F_gid"\n", Getgid()); |
|||
fprintf(outfile, "effective group id = "F_gid"\n", Getegid()); |
|||
|
|||
{ |
|||
struct rlimit rlim; |
|||
|
|||
fprintf(outfile, "\nRESOURCE LIMITS\n"); |
|||
fprintf(outfile, "resource current maximum\n"); |
|||
if (getrlimit(RLIMIT_CPU, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_CPU, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"cpu time (seconds) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_FSIZE, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"file size (blocks) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
if (getrlimit(RLIMIT_DATA, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_DATA, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"data seg size (kbytes) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
if (getrlimit(RLIMIT_STACK, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_STACK, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"stack size (blocks) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
if (getrlimit(RLIMIT_CORE, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_CORE, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"core file size (blocks) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#ifdef RLIMIT_RSS /* Linux, AIX; not Cygwin */ |
|||
if (getrlimit(RLIMIT_RSS, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_RSS, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"max resident set size %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#endif |
|||
#ifdef RLIMIT_NPROC /* Linux, not AIX, Cygwin */ |
|||
if (getrlimit(RLIMIT_NPROC, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_NPROC, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"max user processes %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#endif |
|||
#ifdef RLIMIT_NOFILE /* not AIX 4.1 */ |
|||
if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_NOFILE, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"open files %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#endif |
|||
#ifdef RLIMIT_MEMLOCK /* Linux, not AIX, Cygwin */ |
|||
if (getrlimit(RLIMIT_MEMLOCK, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_MEMLOCK, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"max locked-in-memory\n address space %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#endif |
|||
#ifdef RLIMIT_AS |
|||
if (getrlimit(RLIMIT_AS, &rlim) < 0) { |
|||
Warn2("getrlimit(RLIMIT_AS, %p): %s", &rlim, strerror(errno)); |
|||
} else { |
|||
fprintf(outfile, |
|||
"virtual memory (kbytes) %24"F_rlim_max"%24"F_rlim_max"\n", |
|||
rlim.rlim_cur, rlim.rlim_max); |
|||
} |
|||
#endif |
|||
} |
|||
|
|||
/* file descriptors */ |
|||
|
|||
/* what was this for?? */ |
|||
/*Sleep(1);*/ |
|||
return 0; |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
/* source: procan.h */ |
|||
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
|||
/* Published under the GNU General Public License V.2, see file COPYING */ |
|||
|
|||
#ifndef __procan_h_included |
|||
#define __procan_h_included 1 |
|||
|
|||
extern int procan(FILE *outfile); |
|||
extern int procan_cdefs(FILE *outfile); |
|||
|
|||
#endif /* !defined(__procan_h_included) */ |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue