You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4976 lines
116 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. # source: xio.help
  2. # Copyright Gerhard Rieger and contributors (see file CHANGES)
  3. Operating systems:
  4. The options and features described in this document have been implemented (but
  5. not always tested) on the operating systems listed below, unless otherwise
  6. noted:
  7. SuSE 10.1 Linux on x86
  8. Solaris 8 on Sparc with gcc
  9. FreeBSD 6.1 on x86
  10. HP-UX B 11.11 on PA-RISC with gcc
  11. ===============================================================================
  12. The following sections describe the syntax and semantics of the socat command
  13. line stream arguments.
  14. Usually a socat stream argument defines a one- or bidirectional stream. There
  15. are two principal forms:
  16. * a single stream. Depending on use of the -u or -U options and implicit
  17. semantics of the stream, such an argument may be resolved to a one- or
  18. twodirectional stream.
  19. * two onedirectional streams, separated by '!!'. An argument of this form
  20. always specifies a twodirectional stream. The first single stream is only used
  21. for reading data, and the second is only used for writing data.
  22. The general structure of a single stream is:
  23. keyword[:required-parameters][,options]
  24. The options part starts with the first ',' of the argument. The required
  25. parameters are separated by ':' from their predecessor. The last required
  26. parameter is terminated by the end of the argument or by the first ',' that
  27. iitroduces the first option. The options are separated with ','. The last
  28. option is terminated by end-of-string or by '!!'.
  29. The are some abbreviations defined that allow to drop the keyword. In these
  30. cases the argument syntax is:
  31. required-parameter[:required-parameters][,options]
  32. The implemented abbreviations are:
  33. short form canonical form
  34. number FD:number # decimal number
  35. path GOPEN:path # must must contain at least one '/' and must not contain ':' or ',' and must not start with a decimal digit
  36. ===============================================================================
  37. Addresses:
  38. Every address specification starts with a keyword or an abbreviation. These
  39. keywords are case insensitive.
  40. Note: because the option group ANY applies for all addresses, it is not
  41. mentioned explicitely below.
  42. Bidirectional only addresses:
  43. -----------------------------
  44. PIPE
  45. FIFO
  46. ECHO
  47. Opens an unnamed pipe (fifo) where outbound traffic is sent to and inbound
  48. traffic is read from. The special semantics of pipes results in an echo like
  49. behaviour.
  50. Option groups: FD, FIFO (no specific FIFO options are defined yet)
  51. Onedirectional only addresses:
  52. ------------------------------
  53. Currently all addresses may be used bidirectional.
  54. Note: for regular files, behaviour when being used bidirectionally is
  55. undefined.
  56. One- and bidirectional addresses:
  57. ---------------------------------
  58. STDIO
  59. - ("minus")
  60. Uses stdin (FD 0) for inbound traffic and/or stdout (FD 1) for outbound traffic
  61. on this address.
  62. Option groups: FD; others dependent on actual types of stdin and stdout (FIFO,
  63. CHR, BLK, REG, and/or SOCKET).
  64. STDIN
  65. Uses stdin for traffic. This might fail for outbound traffic.
  66. Option groups: FD; dependent on actual type of stdin (FIFO, CHR, BLK, REG, or
  67. SOCKET).
  68. STDOUT
  69. Uses stdout for traffic. This might fail for inbound traffic.
  70. Option groups: FD; dependent on actual type of stdout (FIFO, CHR, BLK, REG, or
  71. SOCKET).
  72. STDERR
  73. Uses stdout for traffic. This might fail for inbound traffic.
  74. Option group: FD; dependent on actual types of sterr (FIFO, CHR, BLK, REG, or
  75. SOCKET).
  76. FD:num
  77. num
  78. Uses the already existing file descriptor <num> for traffic.
  79. Option groups: FD; dependent on actual types of file descriptor (FIFO, CHR,
  80. BLK, REG, or SOCKET).
  81. READLINE
  82. Uses the GNU readline function and history capabilies (best known from bash).
  83. It always works on stdin and stdout; if stdio is not a tty, readline does not
  84. seem to work correctly.
  85. Because readline is blocking during line editing, it does not fit well into
  86. socats I/O philosophy.
  87. socat integrates readline by waiting in the select call as usual; when stdin
  88. reports available data, socat invokes readline(). readline blocks until the
  89. user presses ENTER or EOF. Data on socats other stream is not handling in this
  90. time.
  91. socat controls the ECHO flag of the stdin tty (off during select(), on for
  92. readline()).
  93. When using socat with readline as front end to a service like telnet, POP3 or
  94. an other authenticated service, please note that the password is entered as
  95. ordinary data, thus appears on the screen!
  96. Option groups: FD, READLINE, TERMIOS
  97. Useful options: history-file
  98. OPEN:path
  99. Applies an open() system call to the given path. If the path does not exist a
  100. file is created only if the option create is used; if a file, pipe, or device
  101. with this name already exists it is opened. Open for reading and/or writing
  102. depends on the rw parameter of the xioopen call, or on usage in a socat
  103. argument. If no perm option is used, xioopen uses 600 (which might be modified
  104. by umask then).
  105. Applying this function to files conforms to the semantics as described by the
  106. open(2) man page.
  107. Opening device files, like /dev/ttyS*, might block until the device gets active
  108. (until some peer is connected)
  109. With existing named pipes (fifos) please note the usual semantics:
  110. Opening the pipe in read/write mode results in an echo service;
  111. Opening the pipe in read mode blocks until a writer opens the pipe (close
  112. by writer gives EOF for the reader); with option nonblock the open call does
  113. not block.
  114. Opening the pipe in write mode blocks until a reader opens the pipe (close
  115. by reader gives "broken pipe" error on next write); with option nonblock the
  116. open call terminates with error "no such device or address" in absence of a
  117. reader.
  118. Opening a named UNIX stream socket with or without a listening peer might
  119. succeed depending on the operating system, but
  120. the resulting file descriptor erronously reports available data immediately,
  121. and the following read() or write() call always fails with "invalid
  122. argument". Even worse, while such a filesystem entry is identified as socket by
  123. "file" command and by fstat(), getsockopt() after open() gives error "Socket operation on non-socket".
  124. Use GOPEN for reasonable behaviour!
  125. Option groups: FD, OPEN, NAMED, and specific for data object type (FILE, FIFO,
  126. CHRDEV+TERMIOS, BLKDEV, or SOCKET).
  127. GOPEN:path
  128. path
  129. "Generic open". Tries to open the given path in a smarter way. If the path
  130. exists and is a socket, it is connected to; if connecting fails,
  131. socat assumes a datagram socket and later uses sendto() calls for data
  132. transfer.
  133. If the path exists and is not a socket, it is opened:
  134. in RDONLY environment for reading from position 0,
  135. in WRONLY environment for appending (O_APPEND),
  136. in RDWR env. for reading and/or writing starting from position 0.
  137. If the path does not exist:
  138. in RDONLY environment this is an error
  139. in WRONLY environment the file is created (O_CREAT)
  140. in RDWR env. for reading and/or writing starting from position 0.
  141. However, these flags may be overriden by user supplied options
  142. (e.g., "append=0")
  143. Option groups: FD, NAMED, and specific for data object type (FILE, FIFO,
  144. CHRDEV+TERMIOS, BLKDEV, or SOCKET).
  145. CREATE:path
  146. CREAT:path
  147. Opens the named file with creat(). With UNIX semantics, this address is just a
  148. variation of the OPEN address, see there for more details.
  149. Note: The creat() system call does not create a completely new file, but
  150. inherits some properties of the old file if it exists, e.g. permissions. Use
  151. option "unlink-early" to remove the old entry before.
  152. Option groups: FD, NAMED, FILE
  153. Useful options: unlink-late
  154. PIPE:path
  155. FIFO:path
  156. Creates and opens a pipe if path does not exist; opens path if it already
  157. exists.
  158. Option groups: FD, NAMED, FIFO
  159. Note: this address uses the mknod(2) system call to create the named pipe. On
  160. FreeBSD, this call requires root privilege
  161. EXEC:cmdline
  162. Forks off a child process after establishing a bidirectional communication
  163. channel (with socketpair, pipes, or pty). The child then starts "cmdline" with
  164. execvp().
  165. Note: spaces and shell meta characters in cmdline must be quoted if socat is
  166. invoked from the command line.
  167. Option groups: FD, FORK, EXEC, SOCKET, SOCK_UNIX, FIFO, TERMIOS
  168. Useful options: path, fdin, fdout, chroot, su, pty, stderr
  169. Note: on AIX, search permissions on /dev/pts/ are required to use option pty.
  170. SYSTEM:cmdline
  171. Forks off a child process after establishing a bidirectional communication
  172. channel (with socketpair, pipes, or pty). The child then starts "cmdline" with
  173. system().
  174. Note: spaces and shell meta characters in cmdline must be quoted if socat is
  175. invoked from the command line.
  176. Option groups: FD, FORK, EXEC, SOCKET, SOCK_UNIX, FIFO, TERMIOS
  177. Useful options: path, fdin, fdout, chroot, su, pty, stderr
  178. Note: there are slightly different semantics with options pty or pipes, because
  179. they do not communicate an EOF condition to the shell process. Therefore, the
  180. shell process and its child do not terminate due to EOF, but are explicitly
  181. killed during close of the socat file handle. Consider using
  182. exec:'/bin/sh -c command',pty...
  183. UNIX:path
  184. LOCAL:path
  185. Connects to a UNIX domain socket.
  186. Option groups: FD, SOCKET, SOCK_UNIX
  187. NOTE: you need rw permissions to connect to a local socket. My Linux answers
  188. with "connection refused" to insufficient permissions, not existing
  189. socket, not a socket, or just a socket entry without a listening process.
  190. NOTE: this address does not implement option group NAMED because its connect
  191. call succeeds only if there is already someone listening, but at this point the
  192. NAMED group actions no longer affect this socket, only the fs entry.
  193. UNIX-listen:path
  194. UNIX-l:path
  195. Create a listening UNIX domain socket. With the fork option, for each accepted
  196. connection a new process is forked off, and more connections are accepted on
  197. the parent socket. Without fork, only the first connection is accepted.
  198. Option groups: FD, NAMED, SOCKET, SOCK_UNIX, LISTEN, CHILD
  199. IP:host:protocol
  200. IP4:host:protocol
  201. Open a raw socket with IP4 protocol. This mode sends packets to and accepts
  202. them only from host. protocol is a number from 0 to 255, with 1 meaning ICMP,
  203. 6..TCP, 17..UDP, 255..raw IP; 0 might be unsupported by the local IP stack,
  204. resulting in an error.
  205. Requires root privilege.
  206. Note: my Linux 2.4.10 kernel seems to drop payloads smaller than 8
  207. bytes on their way from the network to the application.
  208. Option groups: FD, SOCKET, SOCK_IP
  209. TCP:host:port
  210. TCP4:host:port
  211. INET:host:port
  212. Create a TCP/IP4 client socket and connect to the given host/port combination.
  213. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP
  214. Useful options: crlf, bind, tos, mtudiscover, mss, nodelay,
  215. TCP-l:port
  216. TCP-listen:port
  217. TCP4-l:port
  218. TCP4-listen:port
  219. INET-l:port
  220. INET-listen:port
  221. Create a TCP/IP4 server socket and wait for an incoming connection. With the
  222. fork option, for each accepted connection a new process is forked off, and more
  223. connections are accepted on the parent socket. Without fork, only the first
  224. connection is accepted.
  225. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, LISTEN, RANGE, CHILD
  226. Useful options: fork, crlf, bind, backlog, mtu, tcpwrap
  227. UDP:host:port
  228. UDP-CONNECT:host:port
  229. Connects to port on host using UDP/IP version 4 or 6
  230. depending on address specification, name resolution, or option pf.
  231. Please note that,
  232. due to UDP protocol properties, no real connection is established; data has
  233. to be sent for `connecting' to the server, and no end-of-file condition can
  234. be transported.
  235. Option groups: FD, SOCKET, SOCK_IP4, SOCK_IP6, IP_UDP
  236. Useful options: ttl
  237. UDP4:host:port
  238. UDP4-CONNECT:host:port
  239. Like UDP-CONNECT, but only supports IPv4 protocol.
  240. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_UDP
  241. UDP-listen:port
  242. UDP-l:port
  243. Emulates a UDP server in the same way as netcat: Create a UDP/IP4 socket and
  244. bind to the given port. Then wait for the first packet, get its sender address
  245. (without consuming its data), connect() to this address, and leave xioopen().
  246. Afterwards, our socket only communicates with this peer.
  247. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_UDP, RANGE
  248. Note: with fork option, child processes might hang forever because UDP cannot
  249. transport EOF conditions.
  250. #UDP-dgram:port
  251. #UDP-d:port
  252. #
  253. #Create and use a pure datagram oriented UDP socket.
  254. #The following restrictions apply:
  255. #* range option does not work
  256. #* de facto this is a read-only endpoint: sending data to 0.0.0.0 might fail.
  257. TCP6:host:port
  258. INET6:host:port
  259. Create a TCP/IP6 client socket and connect to the given host/port combination.
  260. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP
  261. Note: Address syntax parsing is awkward, since the IPv6 address word separator
  262. is ':' which is used as port separator too.
  263. An FTP listen entry looks in netstat ":::21"!
  264. TCP6-l:port
  265. TCP6-listen:port
  266. INET6-l:port
  267. INET6-listen:port
  268. Create a TCP server socket and wait for an incoming connection. With the fork
  269. option, for each accepted connection a new process is forked off, and more
  270. connections are accepted on the parent socket. Without fork, only the first
  271. connection is accepted.
  272. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, LISTEN, RANGE, CHILD
  273. SOCKS4:sockd:host:port
  274. SOCKS:sockd:host:port
  275. Use a socks server, socks protocol version 4, to build a TCP (IPv4) connection.
  276. Sockd is the name or address of the socks server, host and port specify the
  277. destination address. Use option socksport if the socks server does not listen
  278. on port 1080.
  279. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, IP_SOCKS
  280. Useful options: sp, socksport, socksuser
  281. Note: If you do not specify option socksuser, xioopen tries to derive it from
  282. environment: LOGNAME or USER, and might therefore undisclose your identity.
  283. SOCKS4a:sockd:host:port
  284. Like SOCKS4, but use the socks version 4a extension for destination name
  285. resolution on the socks server.
  286. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, IP_SOCKS
  287. PTY
  288. Creates a pseudo terminal (pty) and uses its master side. Another process may
  289. open the pty�s slave side using it like a serial line or terminal.
  290. Option groups: FD,NAMED,PTY,TERMIOS
  291. Useful options: link, openpty, mode, user, group
  292. OPENSSL-CONNECT:host:port
  293. OPENSSL:host:port
  294. Tries to establish a SSL connection to port on host using TCP/IPv4.
  295. Note: this is currently only an experimental integration of openssl!
  296. (it does not provide any trust between the peers because is does not check
  297. certificates!)
  298. Option groups: FD,SOCKET,SOCK_IP4,IP_TCP,OPENSSL,RETRY
  299. Useful options: cipher, method, verify, cafile, capath, certificate, bind, sourceport, retry
  300. OPENSSL-LISTEN:port
  301. Listens on tcp4 port. When a connection is accepted, this address behaves as
  302. SSL server.
  303. Option groups: FD,SOCKET,SOCK_IP4,TCP,LISTEN,CHILD,RANGE,OPENSSL,RETRY
  304. Usefule options: cipher, method, verify, cafile, capath, certificate, retry
  305. PROXY:proxy:host:port
  306. PROXY-CONNECT:proxy:host:port
  307. Connects to an HTTP proxy server on port 8080 using TCP/IPv4, and sends a
  308. CONNECT request for host:port. If the proxy grants access and succeeds to
  309. connect to the target, data transfer between socat and the target can
  310. start. Note that the traffic need not be HTTP but can be an arbitrary
  311. protocol.
  312. Option groups: FD,SOCKET,IP4,TCP,HTTP
  313. Useful options: proxyport, ignorecr, proxyauth, crnl, bind, mss, sourceport
  314. ===============================================================================
  315. Option Groups:
  316. Each option is member of one option group. Address definitions specify which
  317. option groups they support. This allows to reject unapplyable options in an
  318. early stage of address processing.
  319. Address groups are identified by single bit positions. Option definitions
  320. specify to which group the option belongs (some options are member or more than
  321. one group). Addresses use a bit pattern to specify which option groups they
  322. support.
  323. Currently the following option groups are defined:
  324. GROUP_FD: All addresses that result in one or more file descriptors. These
  325. options are typically applied with fcntl() or some special calls like fchown()
  326. or fchmod(). There is no documented restriction to apply these functions to any
  327. file descriptor; but they are not always meaningful, and sometimes lead to OS
  328. exceptions.
  329. GROUP_APPL: All addresses. The options do not need file descriptors, because
  330. they manipulate the data streams at application level (ignoreeof, line
  331. terminator conversion).
  332. GROUP_PROCESS: For options that change process related attributes, like user id
  333. (setuid).
  334. GROUP_FIFO: Options for pipes. Currently not used.
  335. GROUP_CHR: Options for character devices. Currently not used.
  336. GROUP_BLK: Options for block devices. Currently not used.
  337. GROUP_REG, GROUP_FILE: Options for regular files. Currently not used.
  338. GROUP_SOCKET: Options for arbitrary type sockets, e.g. so-sndbuf, so-linger.
  339. GROUP_NAMED: Options for file system entries, e.g. user-early, unlink.
  340. GROUP_OPEN: Options that are applied with the open() system call.
  341. GROUP_EXEC: Options for program or script execution, e.g. path.
  342. GROUP_FORK: Options for communication with children processes, e.g. fdin, pty.
  343. GROUP_LISTEN: Options for listening sockets. Only backlog.
  344. GROUP_DEVICE: not used
  345. GROUP_CHILD: Options for addresses that may fork off independent child
  346. processes. Currently only option fork.
  347. GROUP_RETRY: Options for failure handling. Currently not used.
  348. GROUP_TERMIOS: Options for terminal settings, e.g. echo, b38400, raw.
  349. GROUP_READLINE: Options for readline (GNU line editing and history).
  350. GROUP_RANGE: Options for checking peer address. Currently only range.
  351. GROUP_SOCK_UNIX: Options for UNIX domain sockets. Currently not used.
  352. GROUP_SOCK_IP4: Options for IP4 sockets. Currently not used.
  353. GROUP_SOCK_IP6: Options for IP6 sockets. Currently not used.
  354. GROUP_SOCK_IP: Options for IP sockets, e.g. mtu, ip-options, ttl.
  355. GROUP_IP_UDP: Options for UDP sockets. Currently not used.
  356. GROUP_IP_TCP: Options for TCP sockets, e.g. maxseg, nodelay.
  357. GROUP_IPAPP: Options for UDP and TCP sockets. Currently only sourceport.
  358. GROUP_IP_SOCKS4: Options for SOCKS client connections, e.g. socksuser.
  359. GROUP_PROCESS: Options for process wide attributes, e.g. su, chroot.
  360. GROUP_APPL: Options handled by application. Currently not used.
  361. GROUP_PTY: Options for pseudo terminals. Used with addresses PTY, EXEC, and
  362. SYSTEM.
  363. GROUP_OPENSSL: Options for the OPENSSL address.
  364. There are "combined" group definitions too:
  365. #define GROUP_ANY (GROUP_PROCESS|GROUP_APPL)
  366. #define GROUP_ALL 0xffffffff
  367. ===============================================================================
  368. Address Options
  369. Address options are identified by a case insensitive keyword. If the options
  370. needs a parameter value, the option syntax is always:
  371. OPTION=VALUE
  372. Currently there do not exist options that take more than one argument;
  373. sometimes, two values are combined to form one argument value, e.g. IP4 address
  374. and port:
  375. 192.168.0.1:80
  376. Note:
  377. "Type" describes the type of data that may or must be given to the option and
  378. that is passed to the system. There are some options with boolean semantics
  379. (on/off or yes/no), but their values are passed to the system with an int
  380. parameter. This situation is indicated as "Logical type: bool" and "Physical
  381. type: int". In this case xioopen passes the physical value to the system,
  382. giving the user one more hacking playground.
  383. Option: append
  384. Type: BOOL
  385. Option group: FD
  386. Phase: LATE
  387. Platforms: all (UNIX98)
  388. Sets the O_APPEND flag via a fcntl() call and F_SETFL; with OPEN type
  389. addresses, this flag is applied with the open() call. All data written is
  390. appended to the actual file end, even if other processes have written to or
  391. truncated the file in the meantime.
  392. Option: async
  393. Type: BOOL
  394. Option group: FD
  395. Phase: LATE
  396. Platforms: FreeBSD, Linux, SunOS
  397. Sets the O_ASYNC (or FASYNC) flag via a fcntl() call and F_SETFL; with FILE
  398. addresses, this flag is applied with the open() call. Consult your kernel
  399. documentation for effects of this flag.
  400. NOTE: socat does not handle the SIGIO signal.
  401. Option: cloexec
  402. Type: BOOL
  403. Option group: FD
  404. Phase: LATE
  405. Platforms: all
  406. Sets the FD_CLOEXEC (close-on-exec) flag on the file descriptor via a
  407. fcntl()call with F_SETFD. Use with caution, because xioopen() makes use of this
  408. flag to archieve what we consider the most reasonable behaviour; using this
  409. option overrides xioopen's setting!
  410. Option: flock-ex
  411. Aliases: flock, lock
  412. Type: BOOL
  413. Option group: FD
  414. Phase: FD
  415. Platforms: FreeBSD, Linux
  416. Applies the flock(fd, LOCK_EX) call to the file descriptor(s). This locks a file
  417. exclusively (but only for processes also using flock() on this file - otherwise, they seem to have unrestricted access).
  418. If the file is already locked with flock, our flock call blocks until the other
  419. processes lock is released.
  420. Note: the "lock" option name alias applies to this option only
  421. if the fcntl locking mechanism is not available on a platform.
  422. Option: flock-ex-nb
  423. Aliases: flock-nb
  424. Type: BOOL
  425. Option group: FD
  426. Phase: FD
  427. Platforms: FreeBSD, Linux
  428. Applies the flock(fd, LOCK_EX|LOCK_NB) call to the file descriptor(s). This locks a file
  429. exclusively (but only for processes also using flock() on this file -
  430. otherwise, they seem to have unrestricted access).
  431. If the file is already locked with flock, our flock call returns the error
  432. "Resource temporarily unavailable".
  433. Option: flock-sh
  434. Type: BOOL
  435. Option group: FD
  436. Phase: FD
  437. Platforms: FreeBSD, Linux
  438. Applies a shared advisory lock to the file using the flock(fd, LOCK_SH) call.
  439. This prevents processes from locking the file exclusively.
  440. If the file has already an exclusive lock, our flock call blocks until the
  441. other processes lock is released.
  442. Option: flock-sh-nb
  443. Type: BOOL
  444. Option group: FD
  445. Phase: FD
  446. Platforms: FreeBSD, Linux
  447. Applies a shared advisory lock to the file using the flock(fd, LOCK_SH|LOCK_NB) call.
  448. This prevents processes from locking the file exclusively.
  449. If the file has already an exclusive lock, our flock call returns with error
  450. "Resource temporarily unavailable".
  451. Option: f-setlk-rd
  452. Aliases: setlk-rd
  453. Type: BOOL
  454. Option group: FD
  455. Phase: FD
  456. Platforms: all
  457. Locks the complete file with fcntl(fd, F_SETLK, {F_RDLCK}) (complete means from its
  458. start to its maximal length). This locks the file exclusively (but only if the
  459. other processes accessing this file also use f-setlk or f-setlkw - otherwise,
  460. they seem to have unrestricted access). If the file is already locked with
  461. f-setlk or f-setlkw, the fcntl call blocks until release by the other process.
  462. Option: f-setlk-wr
  463. Aliases: f-setlk, setlk-wr, setlk
  464. Type: BOOL
  465. Option group: FD
  466. Phase: FD
  467. Platforms: all
  468. Locks the complete file with fcntl(fd, F_SETLK, {F_WRLCK}) (complete means from its
  469. start to its maximal length). This locks the file exclusively (but only if the
  470. other processes accessing this file also use f-setlk or f-setlkw - otherwise,
  471. they seem to have unrestricted access). If the file is already locked with
  472. f-setlk or f-setlkw, the fcntl call blocks until release by the other process.
  473. Option: f-setlkw-rd
  474. Aliases: setlkw-rd
  475. Type: BOOL
  476. Option group: FD
  477. Phase: FD
  478. Platforms: all
  479. Locks the complete file with fcntl(fd, F_SETLKW, {F_RDLCK}) (complete means from its
  480. start to its maximal length). This locks the file exclusively (but only if the
  481. other processes accessing this file also use f-setlk or f-setlkw - otherwise,
  482. they seem to have unrestricted access). If the file is already locked with
  483. f-setlk or f-setlkw, fcntl returns with EAGAIN.
  484. Option: f-setlkw-wr
  485. Aliases: setlkw-wr, f-setlkw, setlkw, lockw, lock
  486. Type: BOOL
  487. Option group: FD
  488. Phase: FD
  489. Platforms: all
  490. Locks the complete file with fcntl(fd, F_SETLKW, {F_WRLCK}) (complete means from its
  491. start to its maximal length). This locks the file exclusively (but only if the
  492. other processes accessing this file also use f-setlk or f-setlkw - otherwise,
  493. they seem to have unrestricted access). If the file is already locked with
  494. f-setlk or f-setlkw, fcntl returns with EAGAIN.
  495. Option: fork
  496. Type: BOOL
  497. Option group: CHILD
  498. Phase: PASTACCEPT
  499. Platforms: all
  500. Without fork (or fork=0), the listening process accepts exactly one
  501. connections, and terminates afterwards. With fork set, it forks off a new socat
  502. child process for each incoming connection.
  503. It is very important to understand what socat does with this fork option:
  504. The parent process remains in a loop of accept() and fork() calls until
  505. terminated from outside. The child process leaves this loop and goes on with
  506. the socat processing. If the fork occurs in the first address argument, the
  507. child process continues with parsing and activating the second address
  508. argument. This will in most cases be what you want or expect.
  509. If the fork call occurs in socats second address argument, all children will
  510. inherit and share the already activated first address.
  511. Option: group=value
  512. Aliases: gid=value
  513. Type: GIDT or unsigned int
  514. Option group: NAMED
  515. Type: GIDT
  516. Platforms: all
  517. Takes one argument, a UNIX group name or a numeric group id. The first
  518. character of value is a digit for group ids.
  519. With NAMED addresses this option is applied via a chown() call, with a
  520. fchown() call otherwise.
  521. If groupname is a name it must be a valid groupname from /etc/group and is
  522. converted to a group id with a getgrnam(3) call.
  523. On most modern operating systems, the owner of the process must be member of
  524. the group being set; only root may set any group, even numbers without group
  525. name.
  526. A Linux 2.2.10 kernel SIGSEGVs the process in the fchown() call when this
  527. option is used with a socket or pipe. Is fixed with Linux 2.4.
  528. LINUXBUG TESTCASE:
  529. SH1: socat -D - unix-l:/tmp/socket,unlink-early
  530. SH2: socat -d -d -d -d -D gopen:/tmp/socket,group=floppy -
  531. Option: group-late=value
  532. Type: GIDT or string
  533. Option group: FD
  534. Type: GIDT
  535. Platforms: all
  536. Takes one argument, a UNIX group name or a numeric group id. The first
  537. character of value is a digit for group ids.
  538. This option is applied via a fchown(2) call.
  539. If groupname is a name it must be a valid groupname from /etc/group and is
  540. converted to a group id with a getgrnam(3) call.
  541. On most modern operating systems, the owner of the process must be member of
  542. the group being set; only root may set any group, even numberic group ids
  543. without group name.
  544. Option: o-nonblock
  545. Aliases: nonblock
  546. Type: BOOL
  547. Option group: FD
  548. Phase: FD
  549. Platforms: all (UNIX98)
  550. Sets the O_NONBLOCK flag of a file descriptor via a fcntl(2) call and F_SETFL;
  551. with OPEN type addresses, this flag is applied with the open() call.
  552. It does not change the behaviour of socat's data transfer loop because socat
  553. uses select() which blocks nevertheless.
  554. Currently is has only two documented uses:
  555. 1) With address TCP, the connect() call
  556. does not block; instead, it continues through the open step. The channel is
  557. passed to the select() call. If something is written to the channel before it
  558. is connected, this is an error. If connection fails, a read condition occurs
  559. and read() returns the error.
  560. 2) Opening a named pipe does not block with this option.
  561. Option: o-ndelay
  562. Aliases: ndelay
  563. Type: BOOL
  564. Option group: FD
  565. Phase: LATE
  566. Platforms: HP-UX, SunOS (UNIX98)
  567. Under Solaris it sets the O_NDELAY of the file descriptor via a fcntl(2) call
  568. and F_SETFL; with OPEN type addresses, this flag is applied with the open()
  569. call.
  570. With all other operating systems, this is just another name for the nonblock option.
  571. Option: o-noatime
  572. Aliases: noatime
  573. Type: BOOL
  574. Option group: FD
  575. Phase: FD
  576. Platforms: Linux
  577. Sets the O_NOATIME flag of a file descriptor via a fcntl(2) call and F_SETFL;
  578. with OPEN type addresses, this flag is applied with the open() call.
  579. It prevents the access time from being updated during read operations.
  580. Option: perm=value
  581. Aliases: mode=value
  582. Type: MODET (mode_t)
  583. Option group: NAMED
  584. Phase: FD
  585. Platforms: all
  586. This option changes the mode (permissions) of an addresses inode. xioopen
  587. tries to apply this option already during open phase. If the address does not
  588. have a open phase or if the option cannot be applied there, the value is
  589. applied directly on the file descriptor afterwards.
  590. It is up to you to (1) have the permission to change the permissions, and (2)
  591. not to set permissions that prevent you from performing your transactions :-)
  592. NOTE: At least with some Linux 2.2, setting permissions on an existing file or
  593. device with fchmod() does not change the permissions of its inode on disk. See
  594. perm-early which uses chmod() instead.
  595. NOTE: At least with some Linux 2.2, restricting mode on file descriptors does
  596. not restrict this file descriptors data transfer capabilities.
  597. Option: perm-late=value
  598. Type: MODET (mode_t)
  599. Option group: FD
  600. Phase: LATE
  601. Platforms: all
  602. This option changes the mode (permissions) of a file descriptor with fchmod()
  603. in the last phase of address processing.
  604. Option: seek-set=offset
  605. Aliases: lseek=offset, seek=offset
  606. Type: OFF32 or OFF64
  607. Option group: BLK
  608. Phase: LATE
  609. Platforms: HP-UX, Linux, SunOS
  610. Positions the file at the given absolute offset, using lseek() (or lseek64() if
  611. available) with SEEK_SET.
  612. Option: seek-cur=offset
  613. Type: OFF32 or OFF64
  614. Option group: BLK
  615. Phase: LATE
  616. Platforms: HP-UX, Linux, SunOS
  617. Positions the file at the given offset from the current position,
  618. using lseek() (or lseek64() if available) with SEEK_SET.
  619. Option: seek-end=offset
  620. Type: OFF32 or OFF64
  621. Option group: BLK
  622. Phase: LATE
  623. Platforms: HP-UX, Linux, SunOS
  624. Positions the file at the given offset from the file end,
  625. using lseek() (or lseek64() if available) with SEEK_END.
  626. Option: lseek32-set=offset
  627. Aliases: lseek32=offset
  628. Type: OFF32
  629. Option group: BLK
  630. Phase: LATE
  631. Platforms: HP-UX, Linux, SunOS
  632. Positions the file at the given absolute offset using lseek() with SEEK_SET.
  633. This call might fail for non
  634. random access data objects like character devices or sockets.
  635. NOTE: this option seems to be useless on files with O_APPEND set.
  636. Option: lseek32-cur=offset
  637. Type: OFF32 (instead of off_t)
  638. Option group: BLK
  639. Phase: LATE
  640. Platforms: HP-UX, Linux, SunOS
  641. Positions the file at the given offset from the current position using lseek()
  642. with SEEK_CUR. This call
  643. might fail for non random access data objects like character devices.
  644. On Linux, the seek() call fails on pipes, sockets and ttys but works on files
  645. and /dev/null
  646. NOTE: this option seems to be useless on files with O_APPEND set.
  647. Option: lseek32-end=offset
  648. Type: OFF32
  649. Option group: BLK
  650. Phase: LATE
  651. Platforms: HP-UX, Linux, SunOS
  652. Positions the file at the given offset from the file end using lseek() with
  653. SEEK_END. This call might fail
  654. for non random access data objects like character devices.
  655. NOTE: this option seems to be useless on files with O_APPEND set.
  656. Option: lseek64-set=offset
  657. Aliases: lseek64=offset
  658. Type: OFF64
  659. Option group: BLK
  660. Phase: LATE
  661. Platforms: all
  662. Positions the file at the given absolute offset using lseek64() with SEEK_SET.
  663. This call might fail for non
  664. random access data objects like character devices or sockets.
  665. NOTE: this option seems to be useless on files with O_APPEND set.
  666. Option: lseek64-cur=offset
  667. Type: OFF64
  668. Option group: BLK
  669. Phase: LATE
  670. Platforms: all
  671. Positions the file at the given offset from the current position using
  672. lseek64() with SEEK_CUR. This call
  673. might fail for non random access data objects like character devices.
  674. NOTE: this option seems to be useless on files with O_APPEND set.
  675. Option: lseek64-end=offset
  676. Type: OFF64
  677. Option group: BLK
  678. Phase: LATE
  679. Platforms: all
  680. Positions the file at the given offset from the file end using lseek64() with
  681. SEEK_END. This call might fail
  682. for non random access data objects like character devices.
  683. NOTE: this option seems to be useless on files with O_APPEND set.
  684. Option: chroot=path
  685. Type: STRING
  686. Option group: PROCESS
  687. Phase: LATE
  688. Platforms: all
  689. Invokes the chroot() system call with the given path after the address
  690. resolution, so the path names of the address must be specified with absolute
  691. pathes.
  692. Note: when you combine chroot with substuser, with substuser applied within the
  693. chroot environment, usually the etc/passwd and etc/group files in the chroot
  694. environment are used for group set etc.
  695. See appendix "generating a sandbox"
  696. Option: chroot-early=path
  697. Type: STRING
  698. Option group: PROCESS
  699. Phase: EARLY
  700. Platforms: all
  701. Invokes the chroot() system call with the given path before the address is
  702. resolved, this means before file opening in OPEN, GOPEN and before program
  703. execution in EXEC and SYSTEM, so their pathes must be specified related to
  704. their chroot directory.
  705. See appendix "generating a sandbox"
  706. Option: setgid=group
  707. Type: GIDT (gid_t or string)
  708. Option group: PROCESS
  709. Phase: LATE2
  710. Platforms: all
  711. Invokes setgid() with the group id. For EXEC and SYSTEM this call is performed
  712. for the child process after the fork and therefore does not affect the socat
  713. process directly. For LISTEN group addresses with fork option, this call is
  714. performed only on the child processes. For all other addresses, it is performed
  715. in the late phase of address processing, so it does not affect the address
  716. where it is used, but for the next address (if any), and for the data loop.
  717. Note: setgid() does not remove any groups from the current process group set.
  718. Option: setuid=user
  719. Type: UIDT (uid_t or string)
  720. Option group: PROCESS
  721. Phase: LATE2
  722. Platforms: all
  723. Invokes setuid() with the user id. For EXEC and SYSTEM this call is performed
  724. for the child process after the fork and therefore does not affect the socat
  725. process directly. For LISTEN group addresses with fork option, this call is
  726. performed only on the child processes. For all other addresses, it is performed
  727. in the late phase of address processing, so it does not affect the address
  728. where it is used, but the next address (if any), and the data loop.
  729. Note: setuid() is invoked AFTER setgid(), if both are applied.
  730. Note: setuid() does not influence the processes group set; in most cases, you
  731. want to prefer substuser option.
  732. Option: substuser=user
  733. Aliases: su=user
  734. Type: UIDT (uid_t or string)
  735. Option group: PROCESS
  736. Phase: LATE2
  737. Platforms: all
  738. Tries to switch the process to the given user and its group set.
  739. To make sure that the groups are set correctly for the new process owner, the
  740. system calls initgroups(), setgid(), and setuid() are invoked with the
  741. appropriate arguments.
  742. On sane operating system, this option requires root privileges.
  743. Note: this option sets the user and group ids of the process, but does not
  744. change the environment; therefore, all variables including $USER, $HOME,
  745. $LOGNAME, $SHELL etc. are inherited from the old users environment.
  746. Note: starting a SETUID program after applying substuser or setuid gives the
  747. process the SETUID owner, which might give root privileges again.
  748. Option: substuser-delayed=user
  749. Aliases: su-d=user
  750. Type: UIDT (unsigned int or string)
  751. Option group: PROCESS
  752. Phase: INIT
  753. Platforms: all
  754. Like substuser, but reads the user and group information in an early phase of
  755. address processing, but applies the appropriate system calls in a late
  756. phase. This allows to use user information from the host in a chroot
  757. environment, without exposing this data within the sandbox.
  758. Option: o-trunc
  759. Aliases: trunc
  760. Type: BOOL
  761. Option group: OPEN
  762. Phase: LATE
  763. Platforms: all
  764. Sets the O_TRUNC flag of the open() call, thus truncating the file to zero
  765. length.
  766. #! block devices?
  767. Option: ftruncate=value
  768. Aliases: truncate=value
  769. Type: OFF32 or OFF64
  770. Option group: REG
  771. Phase: LATE
  772. Platforms: HP-UX, Linux, SunOS
  773. Invokes the ftruncate() (or ftruncate64() if available) call for the file descriptor with the given value,
  774. thus reducing the length of the file to the given length.
  775. On Linux, ftruncate() fails on sockets and devices but works on regular files
  776. and pipes.
  777. #! block devices?
  778. Note: AIX docu says: for regular files only
  779. Option: ftruncate32=value
  780. Type: OFF32
  781. Option group: REG
  782. Phase: LATE
  783. Platforms: HP-UX, Linux, SunOS
  784. Invokes the ftruncate() call (even if ftruncate64() is available) call for the file descriptor with the given value,
  785. thus reducing the length of the file to the given length.
  786. Option: ftruncate64=value
  787. Type: OFF64
  788. Option group: REG
  789. Phase: LATE
  790. Platforms: all
  791. Invokes the ftruncate64() call if available, for the file descriptor with the given value,
  792. thus reducing the length of the file to the given length.
  793. Option: o-binary
  794. Aliases: binary, bin
  795. Type: BOOL
  796. Option group: FD
  797. Phase: OPEN
  798. Platforms: none; Cygwin
  799. Sets the O_BINARY flag with open() or fcntl() to avoid implicit line terminator conversions.
  800. Option: o-text
  801. Aliases: text
  802. Type: BOOL
  803. Option group: FD
  804. Phase: OPEN
  805. Platforms: none; Cygwin
  806. Sets the O_TEXT flag with open() or fcntl() to force implicit line terminator conversions.
  807. Option: o-noinherit
  808. Aliases: noinherit
  809. Type: BOOL
  810. Option group: FD
  811. Phase: OPEN
  812. Platforms: none; Cygwin
  813. Sets the O_NOINHERIT flag with open() or fcntl() to not keep this file open in a spawned process.
  814. Option: cool-write
  815. Aliases: coolwrite
  816. Type: BOOL
  817. Option group: FD
  818. Phase: INIT
  819. Platforms: all
  820. Takes it easy when write fails with EPIPE or ECONNRESET and logs the message
  821. with notice level instead of error.
  822. This prevents the log file from being filled with useless error messages
  823. when socat is used as a high volume server or proxy where clients often
  824. abort the connection.
  825. This option is experimental.
  826. Option: end-close
  827. Aliases: close
  828. Type: CONST
  829. Option group: FD
  830. Phase: INIT
  831. Platforms: all
  832. Changes the (address dependent) method to close a connection to just close
  833. the file descriptors. This is useful when the connection is to be reused by
  834. or shared with other processes.
  835. Normally, socket connections will be ended with shutdown(2) which
  836. terminates the socket even if it is shared by multiple processes.
  837. close(2) "unlinks" the socket from the process but keeps it active as
  838. long as there are still links from other processes.
  839. Similarly, when an address of type EXEC or SYSTEM is ended, socat usually
  840. will explicitely kill the sub process. With this option, it will just close
  841. the file descriptors.
  842. Option: user=value
  843. Aliases: owner=value, uid=value
  844. Type: UIDT (unsigned int or string)
  845. Option group: NAMED
  846. Phase: FD
  847. Platforms: all
  848. Takes one argument, a UNIX user name or a numeric user id. The first
  849. character of value is a digit for user ids.
  850. For NAMED addresses, if the file already exists, this option is applied via a
  851. chown() call, with fchown() for all other cases.
  852. If username is a name it must be a valid username from /etc/passwd and is
  853. converted to a user id with a getpwnam() call.
  854. On sane operating systems, the owner of the process must be root to change
  855. the owner of a file descriptor; root may even apply undefined (unnamed) user
  856. ids.
  857. My Linux 2.2 kernel SIGSEGVs the process in the fchown() call when this
  858. option is used with a (UNIX, unconnected or connected) socket or pipe. Linux
  859. 2.4.0 handles this call correctly.
  860. TESTCASE: ./socat -d -d -d -d - tcp:loopback:21,user=root
  861. Option: user-late=value
  862. Aliases: uid-l=value
  863. Type: UIDT (unsigned int or string)
  864. Option group: FD
  865. Phase: LATE
  866. Platforms: all
  867. Takes one argument, a UNIX user name or a numeric user id. The first
  868. character of value is a digit for user ids.
  869. This option is applied via a fchown() call just before xioopen_single()
  870. terminates.
  871. If username is a name it must be a valid username from /etc/passwd and is
  872. converted to a user id with a getpwnam() call.
  873. On sane operating systems, the owner of the process must be root to change
  874. the owner of a file descriptor; root may even apply undefined (unnamed) user
  875. ids.
  876. My Linux 2.2 kernel SIGSEGVs the process in the fchown() call when this
  877. option is used with a socket or pipe.
  878. ===============================================================================
  879. OPEN group options
  880. Options of this group may be used with all addresses that support OPEN group
  881. options.
  882. Option: o-rdonly
  883. Aliases: rdonly
  884. Type: BOOL (inherent - no value)
  885. Option group: OPEN
  886. Phase: OPEN
  887. Platforms: all
  888. Use O_RDONLY with the open() call instead of the position dependend default.
  889. Take care not to block later write operations.
  890. Option: o-wronly
  891. Aliases: wronly
  892. Type: BOOL (inherent - no value)
  893. Option group: OPEN
  894. Phase: OPEN
  895. Platforms: all
  896. Use O_WRONLY with the open() call instead of the position dependend default.
  897. Take care not to block later write operations.
  898. Option: o-rdwr
  899. Aliases: rdwr
  900. Type: BOOL (inherent - no value)
  901. Option group: OPEN
  902. Phase: OPEN
  903. Platforms: all
  904. Use O_RDWR with the open() call instead of the position dependend default.
  905. Option: o-create
  906. Aliases: create, creat
  907. Type: BOOL
  908. Option group: OPEN
  909. Phase: OPEN
  910. Platforms: all
  911. Sets the O_CREAT flag of the open() call. This means that it is not an error if
  912. the file does not exist.
  913. Option: o-defer
  914. Aliases: defer
  915. Type: BOOL
  916. Option group: OPEN
  917. Phase: OPEN
  918. Platforms: none
  919. Sets the O_DEFER flag of the open() call. This means that write data is stored
  920. in paging space until an fsync() call.
  921. Option: o-delay
  922. Aliases: delay
  923. Type: BOOL
  924. Option group: OPEN
  925. Phase: OPEN
  926. Platforms: none
  927. Sets the O_DELAY flag of the open() call. This lets open block until the share
  928. conditions are fulfilled (see nshare, rshare)
  929. Option: o-direct
  930. Aliases: direct
  931. Type: BOOL
  932. Option group: OPEN
  933. Phase: OPEN
  934. Platforms: FreeBSD, HP-UX, Linux
  935. Sets the O_DIRECT flag of the open() call.
  936. Option: o-directory
  937. Aliases: directory
  938. Type: BOOL
  939. Option group: OPEN
  940. Phase: OPEN
  941. Platforms: Linux
  942. Sets the O_DIRECTORY flag of the open() call. This lets open fail if the given
  943. path is not a directory. This does not seem to be useful with socat.
  944. Option: o-dsync
  945. Aliases: dsync
  946. Type: BOOL
  947. Option group: OPEN
  948. Phase: OPEN
  949. Platforms: HP-UX, Linux, SunOS (UNIX98)
  950. Sets the O_DSYNC flag with the open() call. This lets write() calls wait until
  951. modification metainfo is physically written to media.
  952. Option: o-excl
  953. Aliases: excl
  954. Type: BOOL
  955. Option group: OPEN
  956. Phase: OPEN
  957. Platforms: all
  958. Sets the O_EXCL flag of the open() call.
  959. Option: o-largefile
  960. Aliases: largefile
  961. Type: BOOL
  962. Option group: OPEN
  963. Phase: OPEN
  964. Platforms: HP-UX, Linux, SunOS
  965. Sets the O_LARGEFILE flag of the open() flag.
  966. Option: o-noctty
  967. Aliases: noctty
  968. Type: BOOL
  969. Option group: OPEN
  970. Phase: OPEN
  971. Platforms: all
  972. Sets the O_NOCTTY flag of the open() call, so the opened device does not become
  973. the controlling tty of the process.
  974. Option: o-nofollow
  975. Aliases: nofollow
  976. Type: BOOL
  977. Option group: OPEN
  978. Phase: OPEN
  979. Platforms: FreeBSD, Linux
  980. Sets the O_NOFOLLOW flag of the open() call. This means that the last component
  981. of the open path must no be a symlink.
  982. Option: o-sync
  983. Aliases: sync
  984. Type: BOOL
  985. Option group: OPEN
  986. Phase: OPEN
  987. Platforms: all (UNIX98)
  988. Sets the O_SYNC flag with the open() call. This lets write() calls wait until
  989. data is physically written to media.
  990. Option: o-rshare
  991. Aliases: rshare
  992. Type: BOOL
  993. Option group: OPEN
  994. Phase: OPEN
  995. Platforms: none
  996. Sets the O_RSHARE flag of the open() call. This means that the file must not be
  997. opened for writing by other processes ("read sharing").
  998. Option: o-nshare
  999. Aliases: nshare
  1000. Type: BOOL
  1001. Option group: OPEN
  1002. Phase: OPEN
  1003. Platforms: none
  1004. Sets the O_NSHARE flag of the open() call. This means that the file must not be
  1005. shared with other processes ("no sharing").
  1006. Option: o-rsync
  1007. Aliases: rsync
  1008. Type: BOOL
  1009. Option group: OPEN
  1010. Phase: OPEN
  1011. Platforms: HP-UX, Linux, SunOS (UNIX98)
  1012. Sets the O_RSYNC flag with the open() call. This lets write() calls wait until
  1013. read metainfo is physically written to media.
  1014. Option: o-priv
  1015. Aliases: priv
  1016. Type: BOOL
  1017. Option group: OPEN
  1018. Phase: OPEN
  1019. Platforms: none (Solaris)
  1020. Sets the O_PRIV flag with the open() call.
  1021. ===============================================================================
  1022. NAMED group options
  1023. This group is valid for all addresses that refer to a file system entry like
  1024. file, device, named pipe, or named UNIX domain socket.
  1025. Option: unlink-early
  1026. Aliases: new
  1027. Type: BOOL
  1028. Option group: NAMED
  1029. Phase: EARLY
  1030. Platforms: all
  1031. This options tries to remove the filesystem entry given in the address before
  1032. starting any other processing (even before user-early, perm-early, or
  1033. group-early). unlink() is called; note that this call, in contrast to rm(1),
  1034. removes entries regardless of their permissions. Instead, ownership or root
  1035. privileges and write permissions in the directory are required and sufficient.
  1036. Option: unlink
  1037. Type: BOOL
  1038. Option group: NAMED
  1039. Phase: PREOPEN
  1040. Platforms: all
  1041. This options tries to remove the filesystem entry given in the address before
  1042. it is tried to open, but past user-early, perm-early, or group-early).
  1043. unlink() is called; note that this call, in contrast to rm(1), removes entries
  1044. regardless of their permissions. Instead, ownership or root privileges and
  1045. write permissions in the directory are required and sufficient.
  1046. Option: unlink-late
  1047. Type: BOOL
  1048. Option group: NAMED
  1049. Phase: PASTOPEN
  1050. Platforms: all
  1051. This option tries to remove the filesystem entry after it has been opened.
  1052. Options can still be applied to the file descriptor, and
  1053. the node or files data can be used, but it can no longer be accessed by other
  1054. processes (except by tricks?), and after closing the stream the data or node is
  1055. completely removed.
  1056. unlink() is called; note that this call, in contrast to rm(1), removes entries
  1057. regardless of their permissions. Instead, ownership or root privileges and
  1058. write permissions in the directory are required and sufficient.
  1059. Option: perm-early=value
  1060. Type: MODET (mode_t)
  1061. Option group: NAMED
  1062. Phase: PREOPEN
  1063. Platforms: all
  1064. This option changes the mode (permissions) of an already existing filesystem
  1065. entry with chmod() before the file is opened or after the UNIX domain socket is
  1066. bound, but before it listens/connects.
  1067. Option: user-early=value
  1068. Aliases: uid-e=value
  1069. Type: UIDT (unsigned int or string)
  1070. Option group: NAMED
  1071. Phase: PREOPEN
  1072. Platforms: all
  1073. Takes one argument, a UNIX user name or a numeric user id. The first
  1074. character of value is a digit for user ids.
  1075. This option is applied via a chown() call before the file system entry is
  1076. opened or after the UNIX domain socket is bound, but before it starts to
  1077. listen/connect.
  1078. If username is a name it must be a valid username from /etc/passwd and is
  1079. converted to a user id with a getpwnam() call.
  1080. On sane operating systems, the owner of the process must be root to change
  1081. the owner of a file descriptor; root may even apply undefined (unnamed) user
  1082. ids.
  1083. Option: group-early=value
  1084. Aliases: gid-e=value
  1085. Type: GIDT (unsigned int or string)
  1086. Option group: NAMED
  1087. Phase: PREOPEN
  1088. Platforms: all
  1089. Takes one argument, a UNIX group name or a numeric group id. The first
  1090. character of value is a digit for group ids.
  1091. This option is applied via a chown() call before the file system entry is
  1092. opened or after the UNIX domain socket is bound, but before it
  1093. listens/connects.
  1094. If groupname is a name it must be a valid groupname from /etc/group and is
  1095. converted to a group id with a getgrnam() call.
  1096. On most modern operating systems, the owner of the process must be member of
  1097. the group being set; only root may set any group, even numbers without group
  1098. name.
  1099. Option: umask=value
  1100. Type: MODET
  1101. Option group: NAMED
  1102. Phase: EARLY
  1103. Platforms: all
  1104. Sets the umask before opening a file or creating a UNIX domain socket. This is
  1105. especially useful for these sockets, because there interface does not provide a
  1106. mode argument.
  1107. Option: unlink-close
  1108. Type: BOOL
  1109. Option group: NAMED
  1110. Phase: LATE
  1111. Platforms: all
  1112. Remove the addresses file system entry when closing the address.
  1113. For named pipes, listening unix domain sockets, and the symbolic links of pty
  1114. addresses, the default is 1; for created files, opened files, generic opened
  1115. files, and client unix domain sockets the default is 0.
  1116. ===============================================================================
  1117. FORK and EXEC options
  1118. Option: path=string
  1119. Type: STRING
  1120. Option group: EXEC
  1121. Phase: PREEXEC
  1122. Platforms: all
  1123. Changes the PATH environment variable in the child process before the exec() or
  1124. system() call.
  1125. Option: nofork
  1126. Type: BOOL
  1127. Option group: FORK
  1128. Phase: BIGEN
  1129. Platforms: all
  1130. Does not fork a subprocess for executing the program, instead calls execvp()
  1131. directly from the actual socat instance. This avoids the overhead of another process
  1132. between the program and the communication peer, but introduces lots of
  1133. restrictions:
  1134. * this option can only be applied to the second socat() address.
  1135. * the first socat address cannot be OPENSSL or READLINE
  1136. * socat options -b, -t, -D, -l, -v, -x, -t become useless
  1137. * for both addresses, options ignoreeof, cr and crnl become useless
  1138. * for the second address (the one with option nofork), options
  1139. append, async, cloexec, flock, user, group, mode, nonblock,
  1140. perm-late, setlk, and setpgid cannot be applied, and should be used on the
  1141. first address instead.
  1142. Option: pipes
  1143. Type: BOOL
  1144. Option group: FORK
  1145. Phase: BIGEN
  1146. Platforms: all
  1147. For communication between the exec() or system() subprocess with socat, use two
  1148. unnamed pipes instead of creating a socket pair.
  1149. Option: pty
  1150. Type: BOOL
  1151. Option group: FORK
  1152. Phase: BIGEN
  1153. Platforms: all
  1154. For communication between the exec() or system() subprocess with socat, use a
  1155. pseudo terminal instead of a socket pair. The executed program gets the slave
  1156. side, and socat the controlling side of the pseudo terminal.
  1157. This is especially useful if you want to use, e.g., chat with socat (see
  1158. EXAMPLES). Plus, ptys do not buffer I/O.
  1159. Note: implementation of pseudo terminals are differing between platforms, so
  1160. extra porting struggles might be required for porting this feature.
  1161. Option: fdin=num
  1162. Type: USHORT
  1163. Option group: FORK
  1164. Phase: PASTBIGEN
  1165. Platforms: all
  1166. After forking the child process, assign the stream where the child
  1167. receives data from socat, to file descriptor num instead of stdin.
  1168. Option: fdout=num
  1169. Type: USHORT
  1170. Option group: FORK
  1171. Phase: PASTBIGEN
  1172. Platforms: all
  1173. After forking the child process, assign the stream where the child
  1174. writes data to socat, to file descriptor num instead of stdout.
  1175. Option: stderr
  1176. Type: BOOL
  1177. Option group: FORK
  1178. Phase: PASTFORK
  1179. Platforms: all
  1180. Normally, the stderr filedescriptor of the forked program is a clone of socat's
  1181. stderr fd. If this option is used, the programs stderr filedescriptor is a copy
  1182. of the "normal" data output of the program, i.e. of its stdout or fdout.
  1183. Option: setsid
  1184. Aliases: sid
  1185. Type: BOOL
  1186. Option group: PROCESS
  1187. Phase: LATE
  1188. Platforms: all
  1189. Invokes setsid() to make the forked off subprocess the leader of a new
  1190. session. This also generates a new process group with this process as leader.
  1191. This is useful, e.g., when exec'ing ssh to get the password prompt into the I/O
  1192. channel (see EXAMPLES)
  1193. Option: setpgid
  1194. Aliases: pgid
  1195. Type: INT
  1196. Option group: FORK
  1197. Phase: LATE
  1198. Platforms: all
  1199. Invokes setpgid(0, val) from the child process.
  1200. Option: tiocsctty
  1201. Aliases: ctty
  1202. Type: BOOL
  1203. Option group: TERMIOS
  1204. Phase: LATE2
  1205. Platforms: all
  1206. Applies only in combination with the pty option or its variants. Tries to make
  1207. the pty the controlling terminal. May require option setsid to work correctly.
  1208. Option: dash
  1209. Aliases: login
  1210. Type: BOOL
  1211. Option group: EXEC
  1212. Phase: PREEXEC
  1213. Platforms: all
  1214. Prefixes argv[0] for the execvp() call with '-', thus making a shell behave as
  1215. login shell.
  1216. Option: sighup
  1217. Type: CONST
  1218. Option group: PARENT
  1219. Phase: LATE
  1220. Platforms: all
  1221. Has socat pass an eventual SIGHUP signal to the sub process.
  1222. If no address has this option, socat terminates on SIGHUP.
  1223. Option: sigint
  1224. Type: CONST
  1225. Option group: PARENT
  1226. Phase: LATE
  1227. Platforms: all
  1228. Has socat pass an eventual SIGINT signal to the sub process.
  1229. If no address has this option, socat terminates on SIGINT.
  1230. Option: sigquit
  1231. Type: CONST
  1232. Option group: PARENT
  1233. Phase: LATE
  1234. Platforms: all
  1235. Has socat pass an eventual SIGQUIT signal to the sub process.
  1236. If no address has this option, socat dumps core and terminates on SIGQUIT.
  1237. ===============================================================================
  1238. PTY options
  1239. These options may be used with addresses that create a pseudo terminal (pty).
  1240. In particular, these are addresses EXEC, SYSTEM, and PTY.
  1241. Option: openpty
  1242. Type: BOOL
  1243. Option group: PTY
  1244. Phase: BIGEN
  1245. Platforms: FreeBSD, Linux
  1246. Like pty, but only use the openpty mechanism, not any other way for pty
  1247. generation.
  1248. Option: ptmx
  1249. Type: BOOL
  1250. Option group: PTY
  1251. Phase: BIGEN
  1252. Platforms: HP-UX, Linux, SunOS
  1253. Like pty, but only use the /dev/ptmx (/dev/ptc on AIX) mechanism, not any other
  1254. way for pty generation.
  1255. Option: symbolic-link=filename
  1256. Type: FILENAME
  1257. Option group: PTY
  1258. Phase: LATE
  1259. Platforms: all
  1260. Generates a symbolic link that points to the actual pseudo terminal (pty). This
  1261. might help to solve the problem that ptys are generated with more or less
  1262. unpredictable names, making it difficult to directly access the socat generated
  1263. pty automatically. With this option, the user can specify a "fix" point in the
  1264. file hierarchy that helps him to access the actual pty.
  1265. Option: pty-wait-slave
  1266. Aliases: wait-slave, waitslave
  1267. Type: BOOL
  1268. Option group: PTY
  1269. Phase: EARLY
  1270. Platforms: all
  1271. Blocks the open phase until a process opens the slave side of the pty.
  1272. Usually, socat continues after generating the pty with opening the next
  1273. address or with entering the transfer engine. With the wait-slave option,
  1274. socat waits until some process opens the slave side of the pty before
  1275. continuing.
  1276. This option only works if the operating system provides the tt(poll())
  1277. system call. And it depends on an undocumented behaviour of pty's, so it
  1278. does not work on all operating systems. It has successfully been tested on
  1279. Linux, FreeBSD, NetBSD, and on Tru64 with openpty.
  1280. Option: pty-interval
  1281. Type: TIMESPEC
  1282. Option group: PTY
  1283. Phase: EARLY
  1284. Platforms: all
  1285. When the wait-slave option is set, socat periodically checks the HUP
  1286. condition using poll() to find if the pty's slave side has been
  1287. opened. The default
  1288. polling interval is 1s. Use the pty-interval option to change this value.
  1289. ===============================================================================
  1290. SOCKET options
  1291. These are options that may be applied to all socket type addresses: UNIX
  1292. (LOCAL) domain sockets (even with EXEC type addresses if not pipes), IP, and
  1293. IPv6.
  1294. Option: so-debug
  1295. Aliases: debug
  1296. Logical type: bool
  1297. Physical type: INT
  1298. Option group: SOCKET
  1299. Phase: PASTSOCKET
  1300. Platforms: all (UNIX98)
  1301. Sets the SO_DEBUG socket option. Requires root.
  1302. Option: so-acceptconn
  1303. Aliases: acceptconn
  1304. Logical type: bool
  1305. Physical type: INT
  1306. Option group: SOCKET
  1307. Phase: PASTSOCKET
  1308. Platforms: all (UNIX98)
  1309. Tries to set the SO_ACCEPTCONN socket option. Read-only!
  1310. Option: so-broadcast
  1311. Aliases: broadcast
  1312. Logical type: bool
  1313. Physical type: INT
  1314. Option group: SOCKET
  1315. Phase: PASTSOCKET
  1316. Platforms: all (UNIX98)
  1317. Sets the SO_BROADCAST socket option.
  1318. Option: so-reuseaddr
  1319. Aliases: reuseaddr
  1320. Logical type: bool
  1321. Physical type: INT
  1322. Option group: SOCKET
  1323. Phase: PASTSOCKET
  1324. Platforms: all (UNIX98)
  1325. Sets the SO_REUSEADDR socket option. Allows to bind to a port even if this
  1326. port is already used for a connection.
  1327. Option: so-keepalive
  1328. Aliases: keepalive
  1329. Logical type: bool
  1330. Physical type: INT
  1331. Option group: SOCKET
  1332. Phase: FD
  1333. Platforms: all (UNIX98)
  1334. Sets the SO_KEEPALIVE socket option.
  1335. Option: so-linger=value
  1336. Aliases: linger=value
  1337. Type: LINGER
  1338. Option group: SOCKET
  1339. Phase: PASTSOCKET
  1340. Platforms: all (UNIX98)
  1341. Activates the SO_LINGER option and sets a value (seconds) for it.
  1342. This lets shutdown() or close() block until data transfers have finished or the
  1343. given value timed out.
  1344. Note: on some systems, the type for setsockopt() is struct { int; int; }
  1345. In this case, xioopen() sets {1,value}.
  1346. Option: so-oobinline
  1347. Aliases: oobinline
  1348. Logical type: bool
  1349. Physical type: INT
  1350. Option group: SOCKET
  1351. Phase: PASTSOCKET
  1352. Platforms: all (UNIX98)
  1353. Sets the SO_OOBINLINE socket option.
  1354. Option: so-sndbuf=value
  1355. Aliases: sndbuf=value
  1356. Type: INT
  1357. Option group: SOCKET
  1358. Phase: PASTSOCKET
  1359. Platforms: all (UNIX98)
  1360. Sets the SO_SNDBUF option of the socket to the given value. This option is
  1361. applied after the socket() (or socketpair()) call.
  1362. NOTE: The kernel might change the effective value:
  1363. My Linux 2.2 with TCP doubles the value, but uses at least 2048.
  1364. Option: so-sndbuf-late=value
  1365. Aliases: sndbuf-late=value
  1366. Type: INT
  1367. Option group: SOCKET
  1368. Phase: LATE
  1369. Platforms: all (UNIX98)
  1370. Sets the SO_SNDBUF option of the socket to the given value. This option is
  1371. applied after the connect() or accept() (or socketpair) call.
  1372. NOTE: The kernel might change the effective value:
  1373. My Linux 2.2 with TCP doubles the value, but uses at least 2048, and a
  1374. maximum of 131070 (system limit?).
  1375. Option: so-rcvbuf=value
  1376. Aliases: rcvbuf=value
  1377. Type: INT
  1378. Option group: SOCKET
  1379. Phase: PASTSOCKET
  1380. Platforms: all (UNIX98)
  1381. Sets the SO_RCVBUF option of the socket to the given value. This option is
  1382. applied after the socket() call.
  1383. NOTE: The kernel might change the effective value:
  1384. My Linux 2.2 with TCP connect doubles the value, but uses at least 256 and
  1385. at most 131070.
  1386. My Linux 2.2 with TCP listen doubles the value but uses at least 11772.
  1387. NOTE: For applying the SO_RCVBUF options after the connect() or accept() calls
  1388. see rcvbuf-late.
  1389. Option: so-rcvbuf-late=value
  1390. Aliases: rcvbuf-late=value
  1391. Type: INT
  1392. Option group: SOCKET
  1393. Phase: LATE
  1394. Platforms: all (UNIX98)
  1395. Sets the SO_RCVBUF option of the socket to the given value. This option is
  1396. applied after the connect() or listen() call.
  1397. NOTE: The kernel might change the effective value:
  1398. My Linux 2.2 with TCP doubles the value, but uses at least 256 and maximal
  1399. 131070.
  1400. NOTE: sequence of this call may be relevant for the effecting value (AIX
  1401. 4.3.3). For applying the SO_RCVBUF option immediately after the socket() call
  1402. see rcvbuf.
  1403. Option: so-error
  1404. Aliases: error
  1405. Logical type: bool
  1406. Physical type: INT
  1407. Option group: SOCKET
  1408. Phase: PASTSOCKET
  1409. Platforms: all (UNIX98)
  1410. Tries to set the SO_ERROR socket option which is a read-only option.
  1411. On my Linux 2.2 it gives "protocol not available".
  1412. Option: so-type=value
  1413. Aliases: type=value
  1414. Type: INT
  1415. Option group: SOCKET
  1416. Phase: PASTSOCKET
  1417. Platforms: all
  1418. Set the sockettype argument of the socket() or socketpair() call. This
  1419. overrides the per
  1420. protocol default (e.g., TCP: SOCK_STREAM). Most values might
  1421. not be supported by a given protocol.
  1422. The following combinations are known to work at least under one OS:
  1423. TCP SOCK_STREAM (system default)
  1424. UDP SOCK_DGRAM (system default)
  1425. IP SOCK_RAW (socat default)
  1426. UNIX SOCK_STREAM (system default)
  1427. UNIX SOCK_DGRAM
  1428. Option: so-dontroute
  1429. Aliases: dontroute
  1430. Logical type: bool
  1431. Physical type: INT
  1432. Option group: SOCKET
  1433. Phase: PASTSOCKET
  1434. Platforms: all (UNIX98)
  1435. Sets the SO_DONTROUTE socket option.
  1436. Option: so-rcvlowat=value
  1437. Aliases: rcvlowat=value
  1438. Type: INT
  1439. Option group: SOCKET
  1440. Phase: PASTSOCKET
  1441. Platforms: all (UNIX98)
  1442. Sets the SO_RCVLOWAT socket option. Cannot be changed in Linux (always
  1443. gives "protocol not available").
  1444. Option: so-rcvtimeo=value
  1445. Aliases: rcvtimeo=value
  1446. Provided type: double
  1447. Physical type: TIMEVAL (long[2])
  1448. Option group: SOCKET
  1449. Phase: PASTSOCKET
  1450. Platforms: all (UNIX98)
  1451. Sets the SO_RCVTIMOE socket option. Cannot be changed in Linux (always
  1452. gives "protocol not available").
  1453. Option: so-sndlowat=value
  1454. Aliases: sndlowat=value
  1455. Type: INT
  1456. Option group: SOCKET
  1457. Phase: PASTSOCKET
  1458. Platforms: all (UNIX98)
  1459. Sets the SO_SNDLOWAT socket option. Cannot be changed in Linux (always
  1460. gives "protocol not available").
  1461. Option: so-sndtimeo=value
  1462. Aliases: sndtimeo=value
  1463. Provided type: double
  1464. Physical type: TIMEVAL (long[2])
  1465. Option group: SOCKET
  1466. Phase: PASTSOCKET
  1467. Platforms: all (UNIX98)
  1468. Sets the SO_SNDTIMEO socket option. Cannot be changed in Linux (always
  1469. gives "protocol not available").
  1470. Option: so-audit
  1471. Aliases: audit
  1472. Type: INT
  1473. Option group: SOCKET
  1474. Phase: PASTSOCKET
  1475. Platforms: none
  1476. Sets the SO_AUDIT socket option.
  1477. Option: so-attach-filter
  1478. Aliases: attach-filter, attachfilter
  1479. Type: INT
  1480. Option group: SOCKET
  1481. Phase: PASTSOCKET
  1482. Platforms: Linux
  1483. Linux docu recommends to use libpcap for this feature.
  1484. "protocol not available", need kernel CONFIG_FILTER!
  1485. Option: so-detach-filter
  1486. Aliases: detach-filter, detachfilter
  1487. Type: INT
  1488. Option group: SOCKET
  1489. Phase: PASTSOCKET
  1490. Platforms: Linux
  1491. See Linux "man 7 socket".
  1492. "protocol not available", need kernel CONFIG_FILTER!
  1493. Option: so-bindtodevice=string
  1494. Aliases: bindtodevice, interface, if
  1495. Type: NAME
  1496. Option group: SOCKET
  1497. Phase: PASTSOCKET
  1498. Platforms: Linux
  1499. Binds the socket to a net interface, e.g. lo0 or eth0 (interface names depend
  1500. on operating system). Might require root privilege.
  1501. Option: so-bsdcompat
  1502. Aliases: bsdcompat
  1503. Logical type: bool
  1504. Physical type: INT
  1505. Option group: SOCKET
  1506. Phase: PASTSOCKET
  1507. Platforms: none
  1508. Sets the SO_BSDCOMPAT socket option. See Linux "man 7 socket".
  1509. Option: so-cksumrecv
  1510. Aliases: cksumrecv
  1511. Logical type: bool
  1512. Physical type: INT
  1513. Option group: SOCKET
  1514. Phase: PASTSOCKET
  1515. Platforms: none
  1516. Sets the SO_CKSUMRECV socket option.
  1517. Option: so-kernaccept
  1518. Aliases: kernaccept
  1519. Logical type: bool
  1520. Physical type: INT
  1521. Option group: SOCKET
  1522. Phase: PASTSOCKET
  1523. Platforms: none
  1524. Sets the SO_KERNACCEPT socket option.
  1525. Option: so-no-check
  1526. Aliases: no-check, nocheck
  1527. Logical type: bool
  1528. Physical type: INT
  1529. Option group: SOCKET
  1530. Phase: PASTSOCKET
  1531. Platforms: Linux
  1532. Sets the SO_NO_CHECK socket option." Intentionally undocumented" under
  1533. Linux (see "man 7 socket"), don't know what it does....
  1534. Option: so-noreuseaddr
  1535. Aliases: noreuseaddr
  1536. Type: INT?
  1537. Option group: SOCKET
  1538. Phase: PASTSOCKET
  1539. Platforms: none
  1540. Sets the SO_NOREUSEADDR socket option.
  1541. Option: passcred
  1542. Aliases: so-passcred
  1543. Type: INT
  1544. Option group: SOCKET
  1545. Phase: PASTSOCKET
  1546. Platforms: Linux
  1547. Sets the SO_PASSCRED option of a socket.
  1548. Option: so-peercred
  1549. Aliases: peercred
  1550. Type: INT3 or int[3]?
  1551. Option group: SOCKET
  1552. Phase: PASTSOCKET
  1553. Platforms: Linux
  1554. Enables receiving of credentials. Read only.
  1555. Not really implemented yet.
  1556. Nevertheless, Gives "Protocol not available".
  1557. Option: so-priority=value
  1558. Aliases: priority=value
  1559. Type: INT
  1560. Option group: SOCKET
  1561. Phase: PASTSOCKET
  1562. Platforms: Linux
  1563. Sets the protocol defined priority for all packets to be sent on this socket.
  1564. Docu says it requires root privileges. Normal user may set 0..6 for UNIX domain
  1565. and TCP client sockets on Linux 2.2. root may send any int value.
  1566. Option: so-reuseport
  1567. Aliases: reuseport
  1568. Type: INT?
  1569. Option group: SOCKET
  1570. Phase: PASTSOCKET
  1571. Platforms: FreeBSD, HP-UX
  1572. Sets the SO_REUSEPORT socket option.
  1573. Option: so-security-authentication
  1574. Aliases: security-authentication, securityauthentication
  1575. Type: INT?
  1576. Option group: SOCKET
  1577. Phase: PASTSOCKET
  1578. Platforms: Linux
  1579. Sets the SO_SECURITY_AUTHENTICATION socket option. Gives "protocol not
  1580. available" error.
  1581. In Linux 2.2.16 source, only exists in asm-*/socket.h
  1582. Option: so-security-encryption-network
  1583. Aliases: security-encryption-network, securityencryptionnetwork
  1584. Type: INT?
  1585. Option group: SOCKET
  1586. Phase: PASTSOCKET
  1587. Platforms: Linux
  1588. Sets the SO_SECURITY_ENCRYPTION_NETWORK option of the socket. Gives "protocol
  1589. not available" error.
  1590. In Linux 2.2.16 source, only exists in asm-*/socket.h
  1591. Option: so-security-encryption-transport
  1592. Aliases: security-encryption-transport, securityencryptiontransport
  1593. Type: INT?
  1594. Option group: SOCKET
  1595. Phase: PASTSOCKET
  1596. Platforms: Linux
  1597. Sets the SO_SECURITY_ENCRYPTION_TRANSPORT option of the socket. Gives "protocol
  1598. not available" error.
  1599. In Linux 2.2.16 source, only exists in asm-*/socket.h
  1600. Option: so-use-ifbufs
  1601. Aliases: use-ifbufs, useifbufs
  1602. Type: INT?
  1603. Option group: SOCKET
  1604. Phase: PASTSOCKET
  1605. Platforms: none
  1606. Sets the SO_USE_IFBUFS socket option.
  1607. Option: so-useloopback
  1608. Aliases: useloopback
  1609. Type: INT?
  1610. Option group: SOCKET
  1611. Phase: PASTSOCKET
  1612. Platforms: FreeBSD, HP-UX, SunOS
  1613. Sets the SO_USELOOPBACK socket option.
  1614. Option: so-dgram-errind
  1615. Aliases: dgram-errind, dgramerrind
  1616. Logical type: bool?
  1617. Physical type: INT?
  1618. Option group: SOCKET
  1619. Phase: PASTSOCKET
  1620. Platforms: SunOS
  1621. Sets the SO_DGRAM_ERRIND flag.
  1622. Option: so-dontlinger
  1623. Aliases: dontlinger
  1624. Type: INT?
  1625. Option group: SOCKET
  1626. Phase: PASTSOCKET
  1627. Platforms: SunOS
  1628. Sets the SO_DONTLINGER socket option.
  1629. Option: so-prototype
  1630. Aliases: prototype
  1631. Type: INT?
  1632. Option group: SOCKET
  1633. Phase: PASTSOCKET
  1634. Platforms: HP-UX, SunOS
  1635. Sets the SO_PROTOTYPE socket option.
  1636. Option: type
  1637. Type: INT
  1638. Option group: SOCKET
  1639. Phase: PASTSOCKET
  1640. Platforms: all
  1641. Sets the type of the socket, usually as argument to the socket() or
  1642. socketpair() call, to <type>. Under Linux, 1 means stream oriented socket, 2
  1643. means datagram socket, and 3 means raw socket.
  1644. Option: protocol-family
  1645. Aliases: pf
  1646. Type: STRING
  1647. Option group: SOCKET
  1648. Phase: PRESOCKET
  1649. Platforms: all
  1650. Forces the use of the specified IP version. <string> can be something like
  1651. "ip4" or "ip6".
  1652. Option: fiosetown
  1653. Logical type: bool
  1654. Physical type: INT
  1655. Option group: SOCKET
  1656. Phase: PASTSOCKET
  1657. Platforms: FreeBSD, Linux
  1658. Sets the FIOSETOWN ioctl (in "man 7 socket" called FIOCSETOWN).
  1659. #Option: ciocspgrp
  1660. #
  1661. #Allowed in addresses: SOCKET
  1662. #Logical type: bool
  1663. #Physical type: int
  1664. #
  1665. #Sets the CIOCSPGRP ioctl.
  1666. #Option: addr=value
  1667. #
  1668. #Allowed in addresses: SOCKET
  1669. #Type: socket-address
  1670. #
  1671. #For client socket, sets the local (bind) address. Not yet implemented.
  1672. Option: bind=socketaddress
  1673. Type: STRING
  1674. Option group: SOCKET
  1675. Phase: BIND
  1676. Platforms: all
  1677. Gives the address to be used in the bind(2) system call. The format of the
  1678. socketaddress depends on the socket type (see below). For "client" sockets this
  1679. option inserts a bind(2) call between socket(2) and connect(2) calls. For
  1680. "server" sockets this option is ignored! For datagram sockets behaviour of this
  1681. option is currently unspecified.
  1682. Note: for client sockets in the UNIX domain this option is not useful: with the
  1683. same address as connect it will conflict with the bind call of the server
  1684. socket; another address for bind is ignored (with Linux 2.2).
  1685. For TCP sockets these formats are currently implemented:
  1686. HOSTNAME
  1687. HOSTNAME:PORT
  1688. IPADDR
  1689. IPADDR:PORT
  1690. :PORT
  1691. .PORT
  1692. Option: connect-timeout=seconds
  1693. Type: TIMEVAL
  1694. Option group: SOCKET
  1695. Phase: PASTSOCKET
  1696. Platforms: all
  1697. Abort the connection attempt after the given time with error status.
  1698. #
  1699. Option: backlog=value
  1700. Type: INT
  1701. Option group: LISTEN
  1702. Phase: LISTEN
  1703. Platforms: all
  1704. Sets the value to be used with the listen(2) system call. The default is 5.
  1705. It does not seem to work for Linux 2.2; Linux seems to allow much more
  1706. established connections, but then they stay even after server process
  1707. shutdown...
  1708. Option: range=address:mask, range=address/bits
  1709. Type: STRING
  1710. Option group: RANGE
  1711. Phase: ACCEPT
  1712. Platforms: all
  1713. Implementation status: only for INET (IP4) addresses
  1714. Defines a subnet where clients may connect from. If other clients connect the
  1715. accepted connection is shut down immediately after examination of the client
  1716. address. If this option is not used, the default is 0.0.0.0:0.0.0.0, allowing
  1717. arbitrary client addresses. bits is the number of high order bits that must
  1718. match between the range value and the clients address.
  1719. Option: tcpwrap, tcpwrap=name
  1720. Type: STRING_NULL
  1721. Option group: RANGE
  1722. Phase: ACCEPT
  1723. Platforms: (depends on libwrap installation)
  1724. Uses the rules introduced by Wietse Venema's libwrap (tcpd) library to check
  1725. if the client is allowed to connect. The configuration files are
  1726. /etc/hosts.allow and /etc/hosts.deny. See "man 5 hosts_access" for
  1727. more information. <name> is passed to the wrapper functions as daemon
  1728. process name. If omitted, the basename of socats invokation (argv[0]) is
  1729. passed.
  1730. If both tcpwrap and and range options are applied to an address, both
  1731. conditions must be fulfilled to allow the connection.
  1732. Option: hosts-allow, tcpwrap-hosts-allow-table
  1733. Type: FILENAME
  1734. Option group: RANGE
  1735. Phase: ACCEPT
  1736. Platforms: (depends on libwrap installation)
  1737. Takes the specified file instead of /etc/hosts.allow.
  1738. Option: hosts-deny, tcpwrap-hosts-deny-table
  1739. Type: FILENAME
  1740. Option group: RANGE
  1741. Phase: ACCEPT
  1742. Platforms: (depends on libwrap installation)
  1743. Takes the specified file instead of /etc/hosts.deny.
  1744. Option: tcpwrap-etc, tcpwrap-dir
  1745. Type: FILENAME
  1746. Option group: RANGE
  1747. Phase: ACCEPT
  1748. Platforms: (depends on libwrap installation)
  1749. Looks for hosts.allow and hosts.deny in the specified directory. Is
  1750. overriden by options hosts-allow and hosts-deny.
  1751. -------------------------------------------------------------------------------
  1752. IP options
  1753. Option: ip-options=values
  1754. Aliases: ipoptions
  1755. Type: BIN
  1756. Option group: SOCK_IP
  1757. Phase: PASTSOCKET
  1758. Platforms: all
  1759. Sets the IP_OPTIONS values of the IP socket. For example, to send packets to
  1760. destination D.D.D.D via a router G.G.G.G you have to specify G.G.G.G as the
  1761. "normal" destination, and D.D.D.D in the source route:
  1762. TCP:G.G.G.G:25,ip-options=x890704dddddddd
  1763. Note that the destination will see G.G.G.G as sender of the packets, and
  1764. therefore might not return the answers correctly.
  1765. See RFC791 for detailed specification of IP option fields.
  1766. Examples:
  1767. x01 ... nop
  1768. x8307040a000001 ... loose source route
  1769. x890b040a000001c0c1c2c3 ... strict source route
  1770. Note: with source routes, you should not specifiy destination address and
  1771. hops as defined in RFC791 (first hop as IP header destination address,
  1772. further hops and final destination in source route) because the (Linux?) kernel changes
  1773. them to a more intuitive form (final destination as destination in IP header,
  1774. gateways in source route). So, in destination address give the final
  1775. destination, and in the source route the gateways!
  1776. Note: this option may be mulitply applied per socket but the (Linux?) kernel
  1777. pads each setting with 0' to align the options end to 4 octets. So you should
  1778. better pad the options data with nops (01) yourself.
  1779. Option: ip-pktinfo
  1780. Aliases: ippktinfo, pktinfo
  1781. Type: INT (should be struct in_pktinfo)
  1782. Option group: SOCK_IP
  1783. Phase: PASTSOCKET
  1784. Platforms: Linux
  1785. Status: Not completely implemented (ancillary messages are not supported by
  1786. socat/xio)
  1787. Pass an IP_PKTINFO ancillary message.
  1788. Option: ip-recvtos
  1789. Aliases: iprecvtos, recvtos
  1790. Logical type: bool
  1791. Physical type: INT
  1792. Option group: SOCK_IP
  1793. Phase: PASTSOCKET
  1794. Platforms: Linux
  1795. Status: Not completely implemented (ancillary messages are not supported by
  1796. socat/xio)
  1797. Set the IP_RECVTOS socket option which enables IP_TOS ancillary message
  1798. passing.
  1799. Option: ip-recvttl
  1800. Aliases: iprecvttl, recvttl
  1801. Logical type: bool
  1802. Physical type: INT
  1803. Option group: SOCK_IP
  1804. Phase: PASTSOCKET
  1805. Platforms: all
  1806. Implementation status: No results.
  1807. Set the IP_RECVTTL socket option.
  1808. Option: ip-recvopts
  1809. Aliases: iprecvopts, recvopts
  1810. Logical type: bool
  1811. Physical type: INT
  1812. Option group: SOCK_IP
  1813. Phase: PASTSOCKET
  1814. Platforms: all
  1815. Implementation status: No results.
  1816. Set the IP_RECVOPTS socket option.
  1817. Option: ip-retopts
  1818. Aliases: ipretopts, retopts
  1819. Logical type: bool
  1820. Physical type: INT
  1821. Option group: SOCK_IP
  1822. Phase: PASTSOCKET
  1823. Platforms: all
  1824. Implementation status: No results.
  1825. Set the IP_RETOPTS socket option.
  1826. Option: ip-tos=value
  1827. Aliases: iptos=value, tos=value
  1828. Logical type: byte
  1829. Physical type: INT
  1830. Option group: SOCK_IP
  1831. Phase: PASTSOCKET
  1832. Platforms: all
  1833. Sets the TOS (type of service) flags for the outgoing IP headers of the
  1834. socket. My Linux 2.2 does not allow to set values other than 0 (probably
  1835. needs some optional kernel features).
  1836. Option: ip-ttl=value
  1837. Aliases: ipttl=value, ttl=value
  1838. Logical type: byte
  1839. Physical type: INT
  1840. Option group: SOCK_IP
  1841. Phase: PASTSOCKET
  1842. Platforms: all
  1843. Sets the TTL (time to live) field for the outgoing IP headers of the socket.
  1844. 0 does not seem to be useful and gives "invalid argument" error in Linux.
  1845. This option can be used to implement a "poor mans traceroute" in conjunction
  1846. with tcpdump.
  1847. Option: ip-hdrincl
  1848. Aliases: iphdrincl, hdrincl
  1849. Logical type: bool
  1850. Physical type: INT
  1851. Option group: SOCK_IP
  1852. Phase: PASTSOCKET
  1853. Platforms: all
  1854. Set the IP_HDRINCL socket option. User will supply IP header before user
  1855. data. For raw IP sockets only. Not tested.
  1856. Option: ip-recverr
  1857. Aliases: iprecverr, recverr
  1858. Type: INT
  1859. Option group: SOCK_IP
  1860. Phase: PASTSOCKET
  1861. Platforms: Linux
  1862. Set the IP_RECVERR socket option.
  1863. Implementation status: No results.
  1864. Option: ip-mtu-discover=value
  1865. Aliases: ipmtudiscover=value, mtudiscover=value
  1866. Type: INT (0..2)
  1867. Option group: SOCK_IP
  1868. Phase: PASTSOCKET
  1869. Platforms: Linux
  1870. Sets the IP_MTU_DISCOVER flag of the IP socket. In Linux there are three values
  1871. defined: 0..dont(never), 1..want(per route), 2..do(always)
  1872. Option: ip-mtu
  1873. Aliases: ipmtu, mtu
  1874. Type: INT
  1875. Option group: SOCK_IP
  1876. Phase: PASTSOCKET
  1877. Platforms: none
  1878. Sets the MTU (maximal transfer unit) of the socket. In Linux this is a
  1879. read-only parameter and results in a "protocol not available" error.
  1880. Option: ip-freebind
  1881. Aliases: ipfreebind, freebind
  1882. Logical type: bool
  1883. Physical type: INT
  1884. Option group: SOCK_IP
  1885. Phase: PASTSOCKET
  1886. Platforms: none
  1887. Allows the socket to locally bind to any address, even those that are
  1888. not covered by an interface address, alias address or a local subnet. Even
  1889. broadcast and multicast addresses are possible.
  1890. Note: this option has been found on Linux 2.4 in <linux/in.h>. This file might
  1891. not be included per default, because it creates errors.
  1892. To make this option available, "make" socat with the CCOPT environment
  1893. variable set to "-DIP_FREEBIND=15"
  1894. Option: ip-router-alert=value
  1895. Aliases: iprouteralert, routeralert
  1896. Type: INT
  1897. Option group: SOCK_IP
  1898. Phase: PASTSOCKET
  1899. Platforms: Linux
  1900. Sets the IP_ROUTER_ALERT socket option. Only works with raw sockets.
  1901. "Invalid argument"
  1902. Option: ip-add-membership=multicast-address:interface-address
  1903. ip-add-membership=multicast-address:interface-name
  1904. ip-add-membership=multicast-address:interface-index
  1905. ip-add-membership=multicast-address:interface-address:interface-name
  1906. ip-add-membership=multicast-address:interface-address:interface-index
  1907. Aliases: add-membership
  1908. ip-membership
  1909. Type: IP_MREQN
  1910. Option group: SOCK_IP
  1911. Phase: PASTSOCKET
  1912. Platforms: all
  1913. Makes the socket member of the specified multicast group. This is currently
  1914. only implemented for IPv4. The option takes the IP address of the multicast
  1915. group and info about the desired network interface. The most common syntax
  1916. is the first one, while the others are only available on systems that
  1917. provide tt(struct mreqn) (Linux).nl()
  1918. The indices of active network interfaces can be shown using the utility
  1919. procan().
  1920. Option: ip-drop-membership
  1921. Not implemented.
  1922. #! Option: ipv6-join-group
  1923. Option: ip-multicast-ttl=byte
  1924. Aliases: ipmulticastttl, multicastttl
  1925. Type: BYTE
  1926. Option group: SOCK_IP
  1927. Phase: PASTSOCKET
  1928. Platforms: all
  1929. Sets the TTL used for outgoing multicast traffic. Default is 1.
  1930. Option: ip-multicast-loop
  1931. Aliases: ipmulticastloop, multicastloop
  1932. Logical type: bool
  1933. Physical type: INT
  1934. Option group: SOCK_IP
  1935. Phase: PASTSOCKET
  1936. Platforms: all
  1937. Specifies if outgoing multicast traffic should loop back to the interface.
  1938. Option: ip-multicast-if=hostname
  1939. Aliases: multicast-if
  1940. Type: IP4NAME
  1941. Option group: SOCK_IP
  1942. Phase: PASTSOCKET
  1943. Platforms: all
  1944. Specifies hostname or address of the network interface to be used for
  1945. multicast traffic.
  1946. Option: ip-pktoptions
  1947. Aliases: ippktoptions, pktoptions, pktopts
  1948. Type: INT?
  1949. Option group: SOCK_IP
  1950. Phase: PASTSOCKET
  1951. Platforms: Linux
  1952. Set the IP_PKTOPTIONS socket option. No docu found.
  1953. Implementation status: "Protocol not available".
  1954. Option: res-debug
  1955. Type: BOOL
  1956. Option group: SOCK_IP
  1957. Phase: INIT
  1958. Platforms: all
  1959. Apply the debug resolver option to all queries of this XIO address.
  1960. Option: res-aaonly
  1961. Aliases: aaonly
  1962. Type: BOOL
  1963. Option group: SOCK_IP
  1964. Phase: INIT
  1965. Platforms: all
  1966. Apply the aaonly resolver option to all queries of this XIO address.
  1967. Option: res-usevc
  1968. Aliases: usevc
  1969. Type: BOOL
  1970. Option group: SOCK_IP
  1971. Phase: INIT
  1972. Platforms: all
  1973. Apply the usevc resolver option to all queries of this XIO address.
  1974. Option: res-primary
  1975. Aliases: primary
  1976. Type: BOOL
  1977. Option group: SOCK_IP
  1978. Phase: INIT
  1979. Platforms: all
  1980. Apply the primary resolver option to all queries of this XIO address.
  1981. Option: res-igntc
  1982. Aliases: igntc
  1983. Type: BOOL
  1984. Option group: SOCK_IP
  1985. Phase: INIT
  1986. Platforms: all
  1987. Apply the igntc resolver option to all queries of this XIO address.
  1988. Option: res-recurse
  1989. Aliases: recurse
  1990. Type: BOOL
  1991. Option group: SOCK_IP
  1992. Phase: INIT
  1993. Platforms: all
  1994. Apply the recurse resolver option to all queries of this XIO address.
  1995. Option: res-defnames
  1996. Aliases: defnames
  1997. Type: BOOL
  1998. Option group: SOCK_IP
  1999. Phase: INIT
  2000. Platforms: all
  2001. Apply the defnames resolver option to all queries of this XIO address.
  2002. Option: res-stayopen
  2003. Aliases: stayopen
  2004. Type: BOOL
  2005. Option group: SOCK_IP
  2006. Phase: INIT
  2007. Platforms: all
  2008. Apply the stayopen resolver option to all queries of this XIO address.
  2009. Option: res-dnsrch
  2010. Aliases: dnsrch
  2011. Type: BOOL
  2012. Option group: SOCK_IP
  2013. Phase: INIT
  2014. Platforms: all
  2015. Apply the dnsrch resolver option to all queries of this XIO address.
  2016. -------------------------------------------------------------------------------
  2017. IP6 options
  2018. Option: ipv6-v6only=value
  2019. Alias: ipv6only, v6only
  2020. Type: BOOL
  2021. Option group: SOCK_IP6
  2022. Phase: PASTSOCKET
  2023. Platforms: FreeBSD, Linux
  2024. Apply the IPV6_V6ONLY socket option to the file descriptor. This controls if
  2025. the socket listens only on the IPv6 protocol or also on IPv4.
  2026. -------------------------------------------------------------------------------
  2027. IPAPP (TCP and UDP) options
  2028. Option: sourceport=value
  2029. Alias: sp=value
  2030. Type: 2BYTE
  2031. Option group: IPAPP (IP_TCP and IP_UDP)
  2032. Phase: LATE
  2033. Platforms: all
  2034. For outgoing (client) TCP and UDP connections, it sets the source port (local port, client side port) of
  2035. the socket connection. For server type addresses, requires the client to use
  2036. this sourceport, otherwise socat immediately shuts down the connection.
  2037. On UNIX class operating systems root privilege are required to set a source
  2038. port between 1 and 1023 incl. 0 gives a "random" port number >= 1024, which is
  2039. the default.
  2040. Option: lowport
  2041. Type: BOOL
  2042. Option group: IPAPP (IP_TCP and IP_UDP)
  2043. Phase: LATE
  2044. Platforms: all
  2045. For outgoing (client) TCP and UDP connections, it sets the source
  2046. to an unused random port between 640 and 1023 incl. On UN*X type operating
  2047. systems, this requires root privilege, and thus guaranties the peer to be
  2048. root authorized.
  2049. With TCP or UDP listen addresses, socat immediately shuts down the
  2050. connection if the client does not use a sourceport <= 1023.
  2051. This mechanism can provide limited authorization under some circumstances.
  2052. -------------------------------------------------------------------------------
  2053. TCP options
  2054. Option: tcp-nodelay
  2055. Aliases: nodelay
  2056. Logical type: bool
  2057. Physical type: INT
  2058. Option group: IP_TCP
  2059. Phase: PASTSOCKET
  2060. Platforms: all
  2061. Sets the TCP_NODELAY flag of the TCP socket. This turns off Nagles algorithm.
  2062. Option: tcp-maxseg
  2063. Aliases: maxseg, mss
  2064. Type: INT
  2065. Option group: IP_TCP
  2066. Phase: PASTSOCKET
  2067. Platforms: all
  2068. Limits the MAXSEG (MSS) value of the TCP socket. This option is applied before
  2069. the connect or listen call, so it is transferred in the SYN packet to the peer
  2070. socket.
  2071. Linux client: 0 gives "invalid argument", higher values are used in SYN
  2072. negotiation, but effective MSS is n-12, at least 8.
  2073. On AIX, this is a read-only option.
  2074. Option: tcp-maxseg-late
  2075. Aliases: maxseg-late, mss-late
  2076. Type: INT
  2077. Option group: IP_TCP
  2078. Phase: CONNECTED
  2079. Platforms: all
  2080. Limits the MAXSEG (MSS) value of the TCP socket. This option is applied past
  2081. the connect or accept call, so it is not transferred as MSS to the peer socket.
  2082. Observation with Linux 2.2: does not influence the size of packets generated
  2083. by the local socket.
  2084. Option: tcp-cork
  2085. Aliases: cork
  2086. Logical type: bool
  2087. Physical type: INT
  2088. Option group: IP_TCP
  2089. Phase: PASTSOCKET
  2090. Platforms: Linux
  2091. Sets the TCP_CORK option.
  2092. Option: tcp-stdurg
  2093. Aliases: stdurg
  2094. Logical type: bool
  2095. Physical type: INT
  2096. Option group: IP_TCP
  2097. Phase: PASTSOCKET
  2098. Platforms: none
  2099. Applies the TCP_STDURG option with setsockopt. This enables RFC 1122 compliant
  2100. urgent point handling.
  2101. Option: tcp-rfc1323
  2102. Aliases: rfc1323
  2103. Logical type: bool
  2104. Physical type: INT
  2105. Option group: IP_TCP
  2106. Phase: PASTSOCKET
  2107. Platforms: none
  2108. Applies the TCP_RFC1323 option with setsockopt. This enables RFC1323 TCP
  2109. enhancements (window scale, timestamp).
  2110. Option: tcp-keepidle
  2111. Aliases: keepidle
  2112. Type: INT
  2113. Option group: IP_TCP
  2114. Phase: PASTSOCKET
  2115. Platforms: Linux
  2116. Sets the TCP_KEEPIDLE value of the socket with setsockopt(). Starts keepalive
  2117. after this period (in seconds?)
  2118. Option: tcp-keepintvl
  2119. Aliases: keepintvl
  2120. Type: INT
  2121. Option group: IP_TCP
  2122. Phase: PASTSOCKET
  2123. Platforms: Linux
  2124. Sets the TCP_KEEPINTVL value of the socket with setsockopt(). Interval between
  2125. keepalives (in seconds?)
  2126. Option: tcp-keepcnt
  2127. Aliases: keepcnt
  2128. Type: INT
  2129. Option group: IP_TCP
  2130. Phase: PASTSOCKET
  2131. Platforms: Linux
  2132. Sets the TCP_KEEPCNT value of the socket with setsockopt(). Number of
  2133. keepalives before death.
  2134. Option: tcp-syncnt
  2135. Aliases: syncnt
  2136. Type: INT
  2137. Option group: IP_TCP
  2138. Phase: PASTSOCKET
  2139. Platforms: Linux
  2140. Sets the TCP_SYNCNT value of the socket with setsockopt(). Number of SYN
  2141. retransmits.
  2142. Option: tcp-linger2
  2143. Aliases: linger2
  2144. Type: INT
  2145. Option group: IP_TCP
  2146. Phase: PASTSOCKET
  2147. Platforms: Linux
  2148. Sets the TCP_LINGER2 value of the socket with setsockopt(). Life time of
  2149. orphaned FIN-WAIT-2 state.
  2150. Option: tcp-defer-accept
  2151. Aliases: defer-accept
  2152. Type: INT
  2153. Option group: IP_TCP
  2154. Phase: PASTSOCKET
  2155. Platforms: Linux
  2156. Sets the TCP_DEFER_ACCEPT value of the socket with setsockopt(). accept() of
  2157. the listener will only return when data arrived at the new connection. The
  2158. value is converted to seconds by some algorithm.
  2159. Option: tcp-window-clamp
  2160. Aliases: window-clamp
  2161. Type: INT
  2162. Option group: IP_TCP
  2163. Phase: PASTSOCKET
  2164. Platforms: Linux
  2165. Sets the TCP_WINDOW_CLAMP value of the socket with setsockopt(). "Bound advertised
  2166. window".
  2167. Option: tcp-info
  2168. Aliases: info
  2169. Type: INT
  2170. Option group: IP_TCP
  2171. Phase: PASTSOCKET
  2172. Platforms: FreeBSD, Linux
  2173. Sets the TCP_INFO value of the socket with setsockopt(). Is a read only option,
  2174. so it always generates an error.
  2175. Option: tcp-quickack
  2176. Aliases: quickack
  2177. Type: INT
  2178. Option group: IP_TCP
  2179. Phase: PASTSOCKET
  2180. Platforms: Linux
  2181. Sets the TCP_QUICKACK option with setsockopt().
  2182. Option: tcp-md5sig
  2183. Aliases: md5sig
  2184. Type: INT
  2185. Option group: IP_TCP
  2186. Phase: PASTSOCKET
  2187. Platforms: none
  2188. Enables generation of MD5 digests on the packets.
  2189. Option: tcp-noopt
  2190. Aliases: noopt
  2191. Type: INT
  2192. Option: group: IP_TCP
  2193. Phase: PASTSOCKET
  2194. Platforms: FreeBSD
  2195. Disables use of TCP options.
  2196. Option: tcp-nopush
  2197. Aliases: nopush
  2198. Type: INT
  2199. Option: group: IP_TCP
  2200. Phase: PASTSOCKET
  2201. Platforms: FreeBSD
  2202. Sets the TCP_NOPUSH option.
  2203. Option: tcp-sack-disable
  2204. Aliases: sack-disable
  2205. Type: INT
  2206. Option: group: IP_TCP
  2207. Phase: PASTSOCKET
  2208. Platforms: none
  2209. Disables use the selective acknowledge feature.
  2210. Option: tcp-signature-enable
  2211. Aliases: signature-enable
  2212. Type: INT
  2213. Option: group: IP_TCP
  2214. Phase: PASTSOCKET
  2215. Platforms: none
  2216. Enables generation of MD5 digests on the packets.
  2217. Option: tcp-abort-threshold
  2218. Aliases: abort-threshold
  2219. Type: INT
  2220. Option group: IP_TCP
  2221. Phase: PASTSOCKET
  2222. Platforms: HP-UX, SunOS
  2223. Sets the time to wait for an answer of the peer on an established connection.
  2224. Option: tcp-conn-abort-threshold
  2225. Aliases: conn-abort-threshold
  2226. Type: INT
  2227. Option group: IP_TCP
  2228. Phase: PASTSOCKET
  2229. Platforms: HP-UX, SunOS
  2230. Sets the time to wait for an answer of the server during the initial connect.
  2231. Option: tcp-keepinit
  2232. Aliases: keepinit
  2233. Type: INT
  2234. Option group: IP_TCP
  2235. Phase: PASTSOCKET
  2236. Platforms: none
  2237. Sets the time to wait for an answer of the server during connect() before
  2238. giving up. Value in half seconds, default is 150 (75s).
  2239. Option: tcp-paws
  2240. Aliases: paws
  2241. Type: BOOL
  2242. Option group: IP_TCP
  2243. Phase: PASTSOCKET
  2244. Platforms: none
  2245. Enables the "protect against wrapped sequence numbers" feature.
  2246. Option: tcp-sackena
  2247. Aliases: sackena
  2248. Type: BOOL
  2249. Option group: IP_TCP
  2250. Phase: PASTSOCKET
  2251. Platforms: none
  2252. Enables selective acknowledge.
  2253. Option: tcp-tsoptena
  2254. Aliases: tsoptena
  2255. Type: BOOL
  2256. Option group: IP_TCP
  2257. Phase: PASTSOCKET
  2258. Platforms: none
  2259. Enables the time stamp option that allows RTT recalculation on existing
  2260. connections.
  2261. ===============================================================================
  2262. SOCKS options
  2263. Option: socksport
  2264. Type: STRING
  2265. Option group: IP_SOCKS4
  2266. Phase: LATE
  2267. Platforms: all
  2268. Overrides the default socks server port 1080
  2269. Option: socksuser
  2270. Type: NAME
  2271. Option group: IP_SOCKS4
  2272. Phase: LATE
  2273. Platforms: all
  2274. Overrides the system derived socks user name ($USER or $LOGNAME or "anonymous")
  2275. ===============================================================================
  2276. HTTP options
  2277. Option: proxyport
  2278. Type: STRING
  2279. Option group: HTTP
  2280. Phase: LATE
  2281. Platforms: all
  2282. Overrides the default HTTP proxy port 8080.
  2283. Option: ignorecr
  2284. Type: BOOL
  2285. Option group: HTTP
  2286. Phase: LATE
  2287. Platforms: all
  2288. The HTTP protocol requires the use of CR+NL as line terminator. When a proxy
  2289. server violates this standard, socat might not understand its answer.
  2290. This option directs socat to interprete NL as line terminator and
  2291. to ignore CR in the answer. Nevertheless, socat sends CR+NL to the proxy.
  2292. Option: proxyauth
  2293. Type: STRING
  2294. Option group: HTTP
  2295. Phase: LATE
  2296. Platforms: all
  2297. Provide "basic" authentication to the proxy server. The argument to the option
  2298. must be the username followed by ':' followed by the password. This string is
  2299. used with a "Proxy-Authorize: Base" header in base64 encoded form.
  2300. Option: resolve
  2301. Type: BOOL
  2302. Option group: HTTP
  2303. Phase: LATE
  2304. Platforms: all
  2305. Per default, socat sends to the proxy a CONNECT request containing the target
  2306. hostname. With this option, socat resolves the hostname locally and sends the
  2307. IP address.
  2308. ===============================================================================
  2309. TERMIOS options
  2310. These options are applied with tcsetattr calls with a struct termios.
  2311. Attention: Applying these options to stdin/stdout when they refer to your
  2312. terminal might directly effect your terminal!
  2313. See Linux:"man 3 termios" and Linux:"man 2 stty"
  2314. -------------------------------------------------------------------------------
  2315. TERMIOS combined modes
  2316. Option: raw
  2317. Type: CONST
  2318. Option group: TERMIOS
  2319. Phase: FD
  2320. Platforms: all
  2321. Is equivalent to
  2322. ignbrk=0,brkint=0,ignpar=0,parmrk=0,inpck=0,istrip=0,inlcr=0,igncr=0,icrnl=0,ixon=0,ixoff=0,iuclc=0,ixany=0,imaxbel=0,opost=0,isig=0,icanon=0,xcase=0,vmin=1,vtime=0
  2323. Option: sane
  2324. Type: CONST
  2325. Option group: TERMIOS
  2326. Phase: FD
  2327. Platforms: all
  2328. Is equivalent to
  2329. cread,ignbrk=0,brkint,inlcr=0,igncr=0,icrnl,ixoff=0,iuclc=0,-ixany=0,imaxbel,opost,olcuc=0,ocrnl=0,onlcr,onocr=0,onlret=0,ofill=0,ofdel=0,nl0,cr0,tab0,bs0,vt0,ff0,isig,icanon,iexten,echo,echoe,echok,echonl=0,noflsh=0,xcase=0,tostop=0,echoprt=0,echoctl,echoke
  2330. -------------------------------------------------------------------------------
  2331. TERMIOS input mode flags
  2332. Option: ignbrk
  2333. Type: BOOL
  2334. Option group: TERMIOS
  2335. Phase: FD
  2336. Platforms: all
  2337. Sets the IGNBRK flag of the terminal driver.
  2338. Option: brkint
  2339. Type: BOOL
  2340. Option group: TERMIOS
  2341. Phase: FD
  2342. Platforms: all
  2343. Sets the BRKINT flag of the terminal driver.
  2344. Option: ignpar
  2345. Type: BOOL
  2346. Option group: TERMIOS
  2347. Phase: FD
  2348. Platforms: all
  2349. Sets the IGNPAR flag of the terminal driver.
  2350. Option: parmrk
  2351. Type: BOOL
  2352. Option group: TERMIOS
  2353. Phase: FD
  2354. Platforms: all
  2355. Sets the PARMRK flag of the terminal driver.
  2356. Option: inpck
  2357. Type: BOOL
  2358. Option group: TERMIOS
  2359. Phase: FD
  2360. Platforms: all
  2361. Sets the INPCK flag of the terminal driver. Enables input parity checking.
  2362. Option: istrip
  2363. Type: BOOL
  2364. Option group: TERMIOS
  2365. Phase: FD
  2366. Platforms: all
  2367. Sets the ISTRIP flag of the terminal driver. Strips off the eighth bit.
  2368. Option: inlcr
  2369. Type: BOOL
  2370. Option group: TERMIOS
  2371. Phase: FD
  2372. Platforms: all
  2373. Sets the INLCR flag of the terminal driver. Translates NL to CR on input.
  2374. Option: igncr
  2375. Type: BOOL
  2376. Option group: TERMIOS
  2377. Phase: FD
  2378. Platforms: all
  2379. Sets the IGNCR flag of the terminal driver. Ignores CR character on input.
  2380. Option: icrnl
  2381. Type: BOOL
  2382. Option group: TERMIOS
  2383. Phase: FD
  2384. Platforms: all
  2385. Sets the ICRNL flag of the terminal driver. Translates CR to NL on input. This
  2386. option is ignored when IGNCR is set.
  2387. Option: iuclc
  2388. Type: BOOL
  2389. Option group: TERMIOS
  2390. Phase: FD
  2391. Platforms: HP-UX, Linux, SunOS
  2392. Sets the IUCLC flag of the terminal driver. Changes characters in input from
  2393. uppercase to lowercase.
  2394. Option: ixon
  2395. Type: BOOL
  2396. Option group: TERMIOS
  2397. Phase: FD
  2398. Platforms: all
  2399. Sets the IXON flag of the terminal driver. Enables XON/XOFF flow control on
  2400. output (?).
  2401. Option: ixany
  2402. Type: BOOL
  2403. Option group: TERMIOS
  2404. Phase: FD
  2405. Platforms: all
  2406. Sets the IXANY flag of the terminal driver. Enables any character to restart
  2407. output.
  2408. Option: ixoff
  2409. Aliases: tandem
  2410. Type: BOOL
  2411. Option group: TERMIOS
  2412. Phase: FD
  2413. Platforms: all
  2414. Sets the IXOFF flag of the terminal driver. Enables XON/XOFF flow control on
  2415. input.
  2416. Option: imaxbel
  2417. Type: BOOL
  2418. Option group: TERMIOS
  2419. Phase: FD
  2420. Platforms: all
  2421. Sets the IMAXBEL flag of the terminal driver. Rings the bell when the input
  2422. queue is full.
  2423. -------------------------------------------------------------------------------
  2424. TERMIOS output mode flags
  2425. Option: opost
  2426. Type: BOOL
  2427. Option group: TERMIOS
  2428. Phase: FD
  2429. Platforms: all
  2430. Sets the OPOST flag of the terminal driver.
  2431. Option: olcuc
  2432. Type: BOOL
  2433. Option group: TERMIOS
  2434. Phase: FD
  2435. Platforms: HP-UX, Linux, SunOS
  2436. Sets the OLCUC flag of the terminal driver.
  2437. Option: onlcr
  2438. Type: BOOL
  2439. Option group: TERMIOS
  2440. Phase: FD
  2441. Platforms: all
  2442. Sets the ONLCR flag of the terminal driver.
  2443. Option: ocrnl
  2444. Type: BOOL
  2445. Option group: TERMIOS
  2446. Phase: FD
  2447. Platforms: all
  2448. Sets the OCRNL flag of the terminal driver.
  2449. Option: onocr
  2450. Type: BOOL
  2451. Option group: TERMIOS
  2452. Phase: FD
  2453. Platforms: all
  2454. Sets the ONOCR flag of the terminal driver.
  2455. Option: onlret
  2456. Type: BOOL
  2457. Option group: TERMIOS
  2458. Phase: FD
  2459. Platforms: all
  2460. Sets the ONLRET flag of the terminal driver.
  2461. Option: ofill
  2462. Type: BOOL
  2463. Option group: TERMIOS
  2464. Phase: FD
  2465. Platforms: HP-UX, Linux, SunOS
  2466. Sets the OFILL flag of the terminal driver.
  2467. Option: ofdel
  2468. Type: BOOL
  2469. Option group: TERMIOS
  2470. Phase: FD
  2471. Platforms: HP-UX, Linux, SunOS
  2472. Sets the OFDEL flag of the terminal driver.
  2473. Option: nldly
  2474. Type: BOOL
  2475. Option group: TERMIOS
  2476. Phase: FD
  2477. Platforms: HP-UX, Linux, SunOS
  2478. Sets the NLDLY flag of the terminal driver. 0 sets the value to NL0, and 1 to
  2479. NL1. See nl0, nl1.
  2480. Option: nl0
  2481. Type: CONST (const bool, always sets 0)
  2482. Option group: TERMIOS
  2483. Phase: FD
  2484. Platforms: HP-UX, Linux, SunOS
  2485. Sets the field NLDLY to the value NL0.
  2486. Option: nl1
  2487. Type: CONST (const bool, always sets 1)
  2488. Option group: TERMIOS
  2489. Phase: FD
  2490. Platforms: HP-UX, Linux, SunOS
  2491. Sets the field NLDLY to the value NL1.
  2492. Option: crdly=value
  2493. Type: UINT (0..3)
  2494. Option group: TERMIOS
  2495. Phase: FD
  2496. Platforms: HP-UX, Linux, SunOS
  2497. Sets the field CRDLY to the given value.
  2498. See cr0, cr1, cr2, cr3.
  2499. Option: cr0
  2500. Type: CONST
  2501. Option group: TERMIOS
  2502. Phase: FD
  2503. Platforms: HP-UX, Linux, SunOS
  2504. Sets the CRDLY field to the value CR0.
  2505. See crdly.
  2506. Option: cr1
  2507. Type: CONST
  2508. Option group: TERMIOS
  2509. Phase: FD
  2510. Platforms: HP-UX, Linux, SunOS
  2511. Sets the CRDLY field to the value CR1.
  2512. See crdly.
  2513. Option: cr2
  2514. Type: CONST
  2515. Option group: TERMIOS
  2516. Phase: FD
  2517. Platforms: HP-UX, Linux, SunOS
  2518. Sets the CRDLY field to the value CR2.
  2519. See crdly.
  2520. Option: cr3
  2521. Type: CONST
  2522. Option group: TERMIOS
  2523. Phase: FD
  2524. Platforms: HP-UX, Linux, SunOS
  2525. Sets the CRDLY field to the value CR3.
  2526. See crdly.
  2527. Option: tab0
  2528. Type: CONST
  2529. Option group: TERMIOS
  2530. Phase: FD
  2531. Platforms: HP-UX, Linux, SunOS
  2532. Sets the horizontal tab delay mask to TAB0.
  2533. See tabdly.
  2534. Option: tab1
  2535. Type: CONST
  2536. Option group: TERMIOS
  2537. Phase: FD
  2538. Platforms: HP-UX, Linux, SunOS
  2539. Sets the horizontal tab delay mask to TAB1.
  2540. See tabdly.
  2541. Option: tab2
  2542. Type: CONST
  2543. Option group: TERMIOS
  2544. Phase: FD
  2545. Platforms: HP-UX, Linux, SunOS
  2546. Sets the horizontal tab delay mask to TAB2.
  2547. See tabdly.
  2548. Option: tab3
  2549. Type: CONST
  2550. Option group: TERMIOS
  2551. Phase: FD
  2552. Platforms: HP-UX, Linux, SunOS
  2553. Sets the horizontal tab delay mask to TAB3.
  2554. See tabdly.
  2555. Option: tabdly=value
  2556. Type: UINT (0..3)
  2557. Option group: TERMIOS
  2558. Phase: FD
  2559. Platforms: HP-UX, Linux, SunOS
  2560. Sets the field TABDLY to the given value.
  2561. See tab0, tab1, tab2, and tab3.
  2562. Option: xtabs
  2563. Type: CONST
  2564. Option group: TERMIOS
  2565. Phase: FD
  2566. Platforms: HP-UX, Linux, SunOS
  2567. Sets the horizontal tab delay mask to XTABS.
  2568. Option: bs0
  2569. Type: CONST (0)
  2570. Option group: TERMIOS
  2571. Phase: FD
  2572. Platforms: HP-UX, Linux, SunOS
  2573. Sets the field BSDLY to the value BS0
  2574. Option: bs1
  2575. Type: CONST (1)
  2576. Option group: TERMIOS
  2577. Phase: FD
  2578. Platforms: HP-UX, Linux, SunOS
  2579. Sets the field BSDLY to the value BS1
  2580. Option: bsdly
  2581. Type: BOOL
  2582. Option group: TERMIOS
  2583. Phase: FD
  2584. Platforms: HP-UX, Linux, SunOS
  2585. Sets the BSDLY flag of the terminal driver. 0 sets the value to BS0, and 1 to
  2586. BS1. See bs0, bs1.
  2587. Option: vt0
  2588. Type: CONST (0)
  2589. Option group: TERMIOS
  2590. Phase: FD
  2591. Platforms: HP-UX, Linux, SunOS
  2592. Sets the field VTDLY to the value VT0
  2593. Option: vt1
  2594. Type: CONST (1)
  2595. Option group: TERMIOS
  2596. Phase: FD
  2597. Platforms: HP-UX, Linux, SunOS
  2598. Sets the field VTDLY to the value VT1
  2599. Option: vtdly
  2600. Type: BOOL
  2601. Option group: TERMIOS
  2602. Phase: FD
  2603. Platforms: HP-UX, Linux, SunOS
  2604. Sets the VTDLY flag of the terminal driver. 0 sets the value to VT0, and 1 to
  2605. VT1. See vt0, vt1.
  2606. Option: ff0
  2607. Type: CONST (0)
  2608. Option group: TERMIOS
  2609. Phase: FD
  2610. Platforms: HP-UX, Linux, SunOS
  2611. Sets the field FFDLY to the value FF0
  2612. See ffdly.
  2613. Option: ff1
  2614. Type: CONST (1)
  2615. Option group: TERMIOS
  2616. Phase: FD
  2617. Platforms: HP-UX, Linux, SunOS
  2618. Sets the field FFDLY to the value FF1
  2619. See ffdly.
  2620. Option: ffdly
  2621. Type: BOOL (0..1)
  2622. Option group: TERMIOS
  2623. Phase: FD
  2624. Platforms: HP-UX, Linux, SunOS
  2625. Sets the FFDLY flag of the terminal driver. 0 sets the value to FF0, and 1 to
  2626. FF1. See ff0, ff1.
  2627. -------------------------------------------------------------------------------
  2628. TERMIOS control mode flags
  2629. Option: cs5
  2630. Type: CONST
  2631. Option group: TERMIOS
  2632. Phase: FD
  2633. Platforms: all
  2634. Sets the field CSIZE to the value CS5
  2635. Option: cs6
  2636. Type: CONST
  2637. Option group: TERMIOS
  2638. Phase: FD
  2639. Platforms: all
  2640. Sets the field CSIZE to the value CS6
  2641. Option: cs7
  2642. Type: CONST
  2643. Option group: TERMIOS
  2644. Phase: FD
  2645. Platforms: all
  2646. Sets the field CSIZE to the value CS7
  2647. Option: cs8
  2648. Type: CONST
  2649. Option group: TERMIOS
  2650. Phase: FD
  2651. Platforms: all
  2652. Sets the field CSIZE to the value CS8
  2653. Option: csize
  2654. Type: UINT (0..3)
  2655. Option group: TERMIOS
  2656. Phase: FD
  2657. Platforms: all
  2658. Sets the field CSIZE. 0..CS5, 1..CS6, 2..CS7, 3..CS8
  2659. Option: cstopb
  2660. Type: BOOL
  2661. Option group: TERMIOS
  2662. Phase: FD
  2663. Platforms: all
  2664. Sets the flag CSTOPB.
  2665. Option: cread
  2666. Type: BOOL
  2667. Option group: TERMIOS
  2668. Phase: FD
  2669. Platforms: all
  2670. Sets the value of the CREAD flag.
  2671. Option: parenb
  2672. Type: BOOL
  2673. Option group: TERMIOS
  2674. Phase: FD
  2675. Platforms: all
  2676. Sets the PARENB flag of the terminal driver.
  2677. Option: parodd
  2678. Type: BOOL
  2679. Option group: TERMIOS
  2680. Phase: FD
  2681. Platforms: all
  2682. Sets the PARODD flag of the terminal driver.
  2683. Option: hupcl
  2684. Aliases: hup
  2685. Type: BOOL
  2686. Option group: TERMIOS
  2687. Phase: FD
  2688. Platforms: all
  2689. Sets the HUPCL flag of the terminal driver.
  2690. Option: clocal
  2691. Type: BOOL
  2692. Option group: TERMIOS
  2693. Phase: FD
  2694. Platforms: all
  2695. Sets the CLOCAL flag of the terminal driver.
  2696. Option: crtscts
  2697. Type: BOOL
  2698. Option group: TERMIOS
  2699. Phase: FD
  2700. Platforms: FreeBSD, Linux, SunOS
  2701. Sets the CRTSCTS flag of the terminal driver.
  2702. Option: b0 (HP-UX, Linux, SunOS)
  2703. Option: b50 (HP-UX, Linux, SunOS)
  2704. Option: b75 (HP-UX, Linux, SunOS)
  2705. Option: b110 (HP-UX, Linux, SunOS)
  2706. Option: b134 (HP-UX, Linux, SunOS)
  2707. Option: b150 (HP-UX, Linux, SunOS)
  2708. Option: b200 (HP-UX, Linux, SunOS)
  2709. Option: b300 (HP-UX, Linux, SunOS)
  2710. Option: b600 (HP-UX, Linux, SunOS)
  2711. Option: b900 (HP-UX)
  2712. Option: b1200 (HP-UX, Linux, SunOS)
  2713. Option: b1800 (HP-UX, Linux, SunOS)
  2714. Option: b2400 (HP-UX, Linux, SunOS)
  2715. Option: b3600 (HP-UX)
  2716. Option: b4800 (HP-UX, Linux, SunOS)
  2717. Option: b7200 (HP-UX)
  2718. Option: b9600 (HP-UX, Linux, SunOS)
  2719. Option: b19200 (HP-UX, Linux, SunOS)
  2720. Option: b38400 (HP-UX, Linux, SunOS)
  2721. Option: b57600 (HP-UX, Linux, SunOS)
  2722. Option: b115200 (HP-UX, Linux, SunOS)
  2723. Option: b230400 (HP-UX, Linux, SunOS)
  2724. Option: b460800 (HP-UX, Linux, SunOS)
  2725. Option: b500000 (Linux)
  2726. Option: b576000 (Linux)
  2727. Option: b921600 (Linux)
  2728. Option: b1000000 (Linux)
  2729. Option: b1152000 (Linux)
  2730. Option: b1500000 (Linux)
  2731. Option: b2000000 (Linux)
  2732. Option: b2500000 (Linux)
  2733. Option: b3000000 (Linux)
  2734. Option: b3500000 (Linux)
  2735. Option: b4000000 (Linux)
  2736. Type: CONST
  2737. Option group: TERMIOS
  2738. Phase: FD
  2739. Sets the baud rate to the implied value. b0 "hangs up" the connection.
  2740. Option: ispeed
  2741. Type: UINT
  2742. Option group: TERMIOS
  2743. Phase: FD
  2744. Platforms: FreeBSD, Linux
  2745. Sets the input baud rate to the specified value. This works on systems where
  2746. struct termios has a special c_ispeed field.
  2747. Option: ospeed
  2748. Type: UINT
  2749. Option group: TERMIOS
  2750. Phase: FD
  2751. Platforms: FreeBSD, Linux
  2752. Sets the input baud rate to the specified value. This works on systems where
  2753. struct termios has a special c_ospeed field.
  2754. -------------------------------------------------------------------------------
  2755. TERMIOS local mode flags
  2756. Option: isig
  2757. Type: BOOL
  2758. Option group: TERMIOS
  2759. Phase: FD
  2760. Platforms: all
  2761. Sets the ISIG flag of the terminal driver.
  2762. Option: icanon
  2763. Type: BOOL
  2764. Option group: TERMIOS
  2765. Phase: FD
  2766. Platforms: all
  2767. Sets the ICANON flag of the terminal driver.
  2768. Option: xcase
  2769. Type: BOOL
  2770. Option group: TERMIOS
  2771. Phase: FD
  2772. Platforms: HP-UX, Linux, SunOS
  2773. Sets the XCASE flag of the terminal driver.
  2774. Option: echo
  2775. Type: BOOL
  2776. Option group: TERMIOS
  2777. Phase: FD
  2778. Platforms: all
  2779. Sets the ECHO flag of the terminal driver.
  2780. Option: echoe
  2781. Aliases: crterase
  2782. Type: BOOL
  2783. Option group: TERMIOS
  2784. Phase: FD
  2785. Platforms: all
  2786. Sets the ECHOE flag of the terminal driver.
  2787. Option: echok
  2788. Type: BOOL
  2789. Option group: TERMIOS
  2790. Phase: FD
  2791. Platforms: all
  2792. Sets the ECHOK flag of the terminal driver.
  2793. Option: echonl
  2794. Type: BOOL
  2795. Option group: TERMIOS
  2796. Phase: FD
  2797. Platforms: all
  2798. Sets the ECHONL flag of the terminal driver.
  2799. Option: echoctl
  2800. Aliases: ctlecho
  2801. Type: BOOL
  2802. Option group: TERMIOS
  2803. Phase: FD
  2804. Platforms: all
  2805. Sets the ECHOCTL flag of the terminal driver.
  2806. Option: echoprt
  2807. Aliases: prterase
  2808. Type: BOOL
  2809. Option group: TERMIOS
  2810. Phase: FD
  2811. Platforms: all
  2812. Sets the ECHOPRT flag of the terminal driver.
  2813. Option: echoke
  2814. Aliases: crtkill
  2815. Type: BOOL
  2816. Option group: TERMIOS
  2817. Phase: FD
  2818. Platforms: all
  2819. Sets the ECHOKE flag of the terminal driver.
  2820. Option: flusho
  2821. Type: BOOL
  2822. Option group: TERMIOS
  2823. Phase: FD
  2824. Platforms: all
  2825. Sets the FLUSHO flag of the terminal driver.
  2826. Option: noflsh
  2827. Type: BOOL
  2828. Option group: TERMIOS
  2829. Phase: FD
  2830. Platforms: all
  2831. Sets the NOFLSH flag of the terminal driver.
  2832. Option: tostop
  2833. Type: BOOL
  2834. Option group: TERMIOS
  2835. Phase: FD
  2836. Platforms: all
  2837. Sets the TOSTOP flag of the terminal driver.
  2838. Option: pendin
  2839. Type: BOOL
  2840. Option group: TERMIOS
  2841. Phase: FD
  2842. Platforms: all
  2843. Sets the PENDIN flag of the terminal driver.
  2844. Option: iexten
  2845. Type: BOOL
  2846. Option group: TERMIOS
  2847. Phase: FD
  2848. Platforms: all
  2849. Sets the IEXTEN flag of the terminal driver.
  2850. -------------------------------------------------------------------------------
  2851. TERMIOS options for functional characters
  2852. Option: vintr=value
  2853. Aliases: intr=value
  2854. Type: BYTE
  2855. Option group: TERMIOS
  2856. Phase: FD
  2857. Platforms: all
  2858. Status: tested
  2859. Sets the value for the VINTR character that interrupts the current process.
  2860. On UNIX systems the preset value usually is 3 (^C).
  2861. Option: vquit=value
  2862. Aliases: quit=value
  2863. Type: BYTE
  2864. Option group: TERMIOS
  2865. Phase: FD
  2866. Platforms: all
  2867. Status: tested
  2868. Sets the value for the VQUIT character that quits the current process.
  2869. On my Linux 2.2 system the preset value is 0x1c (^\).
  2870. Option: verase=value
  2871. Aliases: erase=value
  2872. Type: BYTE
  2873. Option group: TERMIOS
  2874. Phase: FD
  2875. Platforms: all
  2876. Status: tested
  2877. Sets the value for the VERASE character that erases the last character.
  2878. On many UNIX systems the preset value is 0x7f.
  2879. Option: vkill=value
  2880. Aliases: kill=value
  2881. Type: BYTE
  2882. Option group: TERMIOS
  2883. Phase: FD
  2884. Platforms: all
  2885. Status: tested
  2886. Sets the value for the VKILL character that kills (erases) the current line.
  2887. On my Linux 2.2 system systems the preset value is 0x15 (^U).
  2888. Option: veof=value
  2889. Aliases: eof=value
  2890. Type: BYTE
  2891. Option group: TERMIOS
  2892. Phase: FD
  2893. Platforms: all
  2894. Status: tested
  2895. Sets the value for the VEOF character that kills indicate end of file.
  2896. On most UNIX systems the preset value is 0x04 (^D).
  2897. Option: vtime=value
  2898. Aliases: time=value
  2899. Type: BYTE
  2900. Option group: TERMIOS
  2901. Phase: FD
  2902. Platforms: all
  2903. Status: not tested
  2904. Sets the value of VTIME. See "man 1 stty" / time.
  2905. On my Linux 2.2 system the preset value is 0.
  2906. Option: vmin=value
  2907. Aliases: min=value
  2908. Type: BYTE
  2909. Option group: TERMIOS
  2910. Phase: FD
  2911. Platforms: all
  2912. Status: not tested
  2913. Sets the value of VMIN. See "man 1 stty" / time.
  2914. On my Linux 2.2 system the preset value is 1.
  2915. Option: vswtc=value
  2916. Aliases: swtc=value, swtch=value
  2917. Type: BYTE
  2918. Option group: TERMIOS
  2919. Phase: FD
  2920. Platforms: Linux
  2921. Status: not tested
  2922. Sets the value of VSWTC. "Switches to a different shell layer".
  2923. On my Linux 2.2 system the preset value is 0.
  2924. Option: vstart=value
  2925. Aliases: start=value
  2926. Type: BYTE
  2927. Option group: TERMIOS
  2928. Phase: FD
  2929. Platforms: all
  2930. Status: tested
  2931. Sets the value for the VSTART character that resumes data flow after a stop.
  2932. Usually the preset value is 0x11 (^Q).
  2933. Option: vstop=value
  2934. Aliases: stop=value
  2935. Type: BYTE
  2936. Option group: TERMIOS
  2937. Phase: FD
  2938. Platforms: all
  2939. Status: tested
  2940. Sets the value for the VSTOP character that stops output.
  2941. Usually the preset value is 0x13 (^S)
  2942. Option: vsusp=value
  2943. Aliases: susp=value
  2944. Type: BYTE
  2945. Option group: TERMIOS
  2946. Phase: FD
  2947. Platforms: all
  2948. Status: tested
  2949. Sets the value for the VSUSP character that suspends the current foreground
  2950. process and reactivates the shell.
  2951. Usually the preset value is 0x1a (^Z)
  2952. Option: vdsusp=value
  2953. Aliases: dsusp=value
  2954. Type: BYTE
  2955. Option group: TERMIOS
  2956. Phase: FD
  2957. Platforms: FreeBSD, HP-UX, SunOS
  2958. Status: tested
  2959. Sets the value for the VDSUSP character that suspends the current foreground
  2960. process and reactivates the shell.
  2961. Option: veol=value
  2962. Aliases: eol=value
  2963. Type: BYTE
  2964. Option group: TERMIOS
  2965. Phase: FD
  2966. Platforms: all
  2967. Status: tested with awkward results
  2968. Sets the value for the VEOL character that should indicate end of line.
  2969. Not clear what differentiates it from the return key; xterm window put "xterm"
  2970. into the input buffer.
  2971. On my Linux 2.2 system the preset value is 0 (disabled)
  2972. Option: vreprint=value
  2973. Aliases: reprint=value, rprnt=value
  2974. Type: BYTE
  2975. Option group: TERMIOS
  2976. Phase: FD
  2977. Platforms: FreeBSD, Linux, SunOS
  2978. Status: not tested
  2979. Sets the value for the VREPRINT character that should reprint the current line.
  2980. On my Linux 2.2 system the preset value is 0x12 (^R). Nevertheless, bash
  2981. enters backward search mode.
  2982. Option: vdiscard=value
  2983. Aliases: discard=value
  2984. Type: BYTE
  2985. Option group: TERMIOS
  2986. Phase: FD
  2987. Platforms: FreeBSD, Linux, SunOS
  2988. Status: not tested
  2989. Sets the value for the VDISCARD character.
  2990. On my Linux 2.2 system the preset value is 0x0f (^O)
  2991. Option: vwerase=value
  2992. Aliases: werase=value
  2993. Type: BYTE
  2994. Option group: TERMIOS
  2995. Phase: FD
  2996. Platforms: all
  2997. Status: tested
  2998. Sets the value for the VWERASE character that erases the last word.
  2999. On my Linux 2.2 system the preset value is 0x17 (^W)
  3000. Option: vlnext=value
  3001. Aliases: lnext=value
  3002. Type: BYTE
  3003. Option group: TERMIOS
  3004. Phase: FD
  3005. Platforms: all
  3006. Status: tested
  3007. Sets the value for the VLNEXT character that lets the next input character raw
  3008. (not interpreted).
  3009. On my Linux 2.2 system the preset value is 0x16 (^V)
  3010. Option: veol2=value
  3011. Aliases: eol2=value
  3012. Type: BYTE
  3013. Option group: TERMIOS
  3014. Phase: FD
  3015. Platforms: all
  3016. Status: not tested
  3017. Sets the value for the VEOL2 character.
  3018. On my Linux 2.2 system the preset value is 0 (disabled).
  3019. ===============================================================================
  3020. READLINE options
  3021. Option: history-file=filename
  3022. Aliases: history=filename
  3023. Type: STRING
  3024. Option group: READLINE
  3025. Phase: LATE
  3026. Platforms: (depends on libreadline installation)
  3027. Without this option, the readline address uses only a per process history
  3028. list. With this option, socat tries to read history lines during initialization
  3029. from the given file, and on termination writes the old and new lines to the
  3030. file.
  3031. NOTE: currently, no mechanism is implemented for limiting the length of the
  3032. history file.
  3033. NOTE: filename must be a valid relativ or absolute path; "~" is not supported!
  3034. Option: noprompt
  3035. Type: BOOL
  3036. Option group: READLINE
  3037. Phase: LATE
  3038. Platforms: all
  3039. Since version 1.3.3, socat per default tries to determine a prompt -
  3040. that is then passed to the readline call - by remembering the last
  3041. incomplete line of the output. With this option, socat does not pass a
  3042. prompt to the readline call, so it might set the cursor to the first column
  3043. of the terminal.
  3044. Option: noecho
  3045. Type: STRING
  3046. Option group: READLINE
  3047. Phase: LATE
  3048. Platforms: all
  3049. Specifies a regular pattern for a prompt that prevents the following input
  3050. line from being displayed on the screen and from being added to the history.
  3051. The prompt is defined as the text that was output to the readline address
  3052. after the lastest newline character and before an input character was
  3053. typed. The pattern is a regular expression, e.g.
  3054. "^[Pp]assword:.*$" or "([Uu]ser:|[Pp]assword:)". See regex(7) for details.
  3055. Option: prompt
  3056. Type: STRING
  3057. Option group: READLINE
  3058. Phase: LATE
  3059. Platforms: all
  3060. Passes the string as prompt to the readline function. readline prints this
  3061. prompt when stepping through the history. If this string matches a constant
  3062. prompt issued by an interactive program on the other socat address,
  3063. consistent look and feel can be archieved.
  3064. ===============================================================================
  3065. OPENSSL options
  3066. Option: openssl-cipherlist=string
  3067. Aliases: cipherlist=string, ciphers=string, cipher=string
  3068. Type: STRING
  3069. Option group: OPENSSL
  3070. Phase: SPEC
  3071. Platforms: (depends on openssl installation)
  3072. Selects the list of ciphers that may be used for the connection.
  3073. See the man page ciphers(1), section CIPHER LIST FORMAT, for
  3074. detailed information about syntax, values, and default of the cipherlist
  3075. string.
  3076. Several cipher strings may be given, separated by ':'.
  3077. Some simple cipher strings:
  3078. 3DES Uses a cipher suite with triple DES.
  3079. MD5 Uses a cipher suite with MD5.
  3080. aNULL Uses a cipher suite without authentication.
  3081. NULL Does not use encryption.
  3082. HIGH Uses a cipher suite with "high" encryption.
  3083. Note that the peer must support the selected property, or the negotiation
  3084. will fail.
  3085. Option: openssl-method=string
  3086. Aliases: method=string
  3087. Type: STRING
  3088. Option group: OPENSSL
  3089. Phase: SPEC
  3090. Platforms: (depends on openssl installation)
  3091. Sets the protocol version to be used. Valid strings (not case sensitive) are:
  3092. SSLv2 Select SSL protocol version 2.
  3093. SSLv3 Select SSL protocol version 3.
  3094. SSLv23 Select SSL protocol version 2 or 3. This is the default when
  3095. this option is not provided.
  3096. TLSv1 Select TLS protocol version 1.
  3097. Option: openssl-verify=bool
  3098. Aliases: verify=bool
  3099. Type: BOOL
  3100. Option group: OPENSSL
  3101. Phase: SPEC
  3102. Platforms: (depends on openssl installation)
  3103. Controls check of the peer's certificate. Default is 1 (true). Disabling
  3104. verify might open your socket for everyone!
  3105. Option: openssl-certificate=file
  3106. Aliases: cert=file
  3107. Type: FILENAME
  3108. Option group: OPENSSL
  3109. Phase: SPEC
  3110. Platforms: (depends on openssl installation)
  3111. Specifies the file with the certificate. The certificate must be
  3112. in OpenSSL format (*.pem). With openssl-listen, this option is strongly
  3113. recommended: except with cipher aNULL, "no shared ciphers" error might
  3114. occur when no certificate is given.
  3115. Option: openssl-key=file
  3116. Aliases: key
  3117. Type: FILENAME
  3118. Option group: OPENSSL
  3119. Phase: SPEC
  3120. Platforms: (depends on openssl installation)
  3121. Specifies the file with the private key. The private key may be in this
  3122. file or in the file given with the ref(cert) option. The party that has
  3123. to proof that it is the owner of a certificate needs the private key.
  3124. Option: openssl-cafile=file
  3125. Aliases: cafile
  3126. Type: FILENAME
  3127. Option group: OPENSSL
  3128. Phase: SPEC
  3129. Platforms: (depends on openssl installation)
  3130. Specifies the file with the trusted (root) authority certificates. The file
  3131. must be in PEM format and should contain one or more certificates.
  3132. Option: openssl-capath=directory
  3133. Aliases: capath
  3134. Type: FILENAME
  3135. Option group: OPENSSL
  3136. Phase: SPEC
  3137. Platforms: (depends on openssl installation)
  3138. Specify the directory with the trusted (root) certificates. The directory
  3139. must contain certificates in PEM format and their hashes (see OpenSSL
  3140. documentation)
  3141. Option: openssl-egd=file
  3142. Aliases: egd
  3143. Type: FILENAME
  3144. Option group: OPENSSL
  3145. Phase: SPEC
  3146. Platforms: (depends on openssl installation)
  3147. On some systems, openssl requires an explicit source of random data. Specify
  3148. the socket name where an entropy gathering daemon like egd provides random
  3149. data, e.g. /dev/egd-pool.
  3150. Option: openssl-pseudo
  3151. Aliases: pseudo
  3152. Type: BOOL
  3153. Option group: OPENSSL
  3154. Phase: SPEC
  3155. Platforms: (depends on openssl installation)
  3156. On systems where openssl cannot find an entropy source and where no entropy
  3157. gathering daemon can be utilized, this option activates a mechanism for
  3158. providing pseudo entropy. This is archieved by taking the current time in
  3159. microseconds for feeding the libc pseudo random number generator with an
  3160. initial value. openssl is then feeded with output from random calls.
  3161. NOTE:This mechanism is not sufficient for generation of secure keys!
  3162. Option: openssl-fips
  3163. Aliases: fips
  3164. Type: BOOL
  3165. Option group: BOOL
  3166. Phase: SPEC
  3167. Platforms: (depends on OpenSSL installation and FIPS implementation)
  3168. Enables FIPS mode if compiled in. For info about the FIPS encryption
  3169. implementation standard see http://oss-institute.org/fips-faq.html.
  3170. This mode might require that the involved certificates are generated with a
  3171. FIPS enabled version of openssl. Setting or clearing this option on one
  3172. socat address affects all OpenSSL addresses of this process.
  3173. Option: openssl-compress
  3174. Aliases: compress
  3175. Type: STRING
  3176. Option group: OPENSSL
  3177. Phase: SPEC
  3178. Platforms: (depends on openssl installation)
  3179. Enable or disable the use of compression for a connection. Setting this to
  3180. "none" disables compression, setting it to "auto" lets OpenSSL choose the best
  3181. available algorithm supported by both parties. The default is to not touch any
  3182. compression-related settings.
  3183. NOTE: Requires OpenSSL 0.9.8 or higher.
  3184. NOTE: Disabling compression with OpenSSL 0.9.8 affects all new connections in
  3185. the same process.
  3186. ===============================================================================
  3187. Application specific address options
  3188. Option: ignoreeof
  3189. Aliases: ignoreof
  3190. Type: BOOL
  3191. Option group: APPL
  3192. Phase: LATE
  3193. Platforms: all
  3194. This option has to be supported by the application. For socat it means that an
  3195. EOF condition on this data source does not trigger termination procedures, but
  3196. instead the read/write loop waits for one second and then tries to read more
  3197. input data. This behaviour emulates "tail -f" and might not be useful for all
  3198. kinds of input devices, but regular files and /dev/null are good candidates.
  3199. Termination of socat then can only occur by EOF condition of the other input
  3200. device, an error, or by external events.
  3201. Option: cr
  3202. Type: CONST
  3203. Option group: APPL
  3204. Phase: LATE
  3205. Platforms: all
  3206. The appropriate data endpoint uses CR ('\r', 0x0d) as line terminator
  3207. character. Convert data to and from this stream appropriately.
  3208. This is useful for, e.g., modems.
  3209. Option: crnl
  3210. Aliases: crlf
  3211. Type: CONST
  3212. Option group: APPL
  3213. Phase: LATE
  3214. Platforms: all
  3215. The appropriate data endpoint uses CR+LF ("\r\n", 0x0d0a ) as line terminator
  3216. string. Convert data to and from this stream appropriately.
  3217. This is useful for, e.g., TCP protocols like SMTP and FTP.
  3218. Option: readbytes=num
  3219. Aliases: bytes
  3220. Type: SIZE_T
  3221. Option group: APPL
  3222. Phase: LATE
  3223. Platforms: all
  3224. socat reads only so many bytes from this address (the address provides
  3225. only so many bytes for transfer and pretends to be at EOF afterwards).
  3226. Option: lockfile=filename
  3227. Type: FILENAME
  3228. Option group: APPL
  3229. Phase: INIT
  3230. Platforms: all
  3231. If lockfile exists, exits with error. If lockfile does not exist, creates it
  3232. and continues; removes lockfile on exit.
  3233. Option: waitlock=filename
  3234. Type: FILENAME
  3235. Option group: APPL
  3236. Phase: INIT
  3237. Platforms: all
  3238. If lockfile exists, waits until it disappears. When lockfile does not exist,
  3239. creates it and continues; removes lockfile on exit.
  3240. ===============================================================================
  3241. RETRY options
  3242. Option: retry=<num>
  3243. Type: UINT
  3244. Option group: RETRY
  3245. Phase: INIT
  3246. Platforms: all
  3247. Number of retries before the connection or listen attempt is aborted.
  3248. Default is 0, which means just one attempt.
  3249. Option: interval=<double>
  3250. Type: TIMESPEC
  3251. Option group: RETRY
  3252. Phase: INIT
  3253. Platforms: all
  3254. Time between consecutive attempts (seconds). Default is 1 second.
  3255. Option: forever
  3256. Type: BOOL
  3257. Option group: RETRY
  3258. Phase: INIT
  3259. Platforms: all
  3260. Performs an unlimited number of retry attempts.
  3261. ===============================================================================
  3262. EXT2 options
  3263. Option: ext2-secrm=<bool>
  3264. Aliases: secrm=<bool>
  3265. Type: BOOL
  3266. Option group: REG
  3267. Phase: FD
  3268. Platforms: Linux
  3269. Sets the secrm file attribute on the file.
  3270. Option: ext2-unrm=<bool>
  3271. Aliases: unrm=<bool>
  3272. Type: BOOL
  3273. Option group: REG
  3274. Phase: FD
  3275. Platforms: Linux
  3276. Sets the unrm file attribute on the file.
  3277. Option: ext2-compr=<bool>
  3278. Aliases: compr=<bool>
  3279. Type: BOOL
  3280. Option group: REG
  3281. Phase: FD
  3282. Platforms: Linux
  3283. Sets the compr file attribute on the file.
  3284. Option: ext2-sync=<bool>
  3285. Type: BOOL
  3286. Option group: REG
  3287. Phase: FD
  3288. Platforms: all
  3289. Sets the sync file attribute on the file.
  3290. Option: ext2-immutable=<bool>
  3291. Aliases: immutable=<bool>
  3292. Type: BOOL
  3293. Option group: REG
  3294. Phase: FD
  3295. Platforms: Linux
  3296. Sets the immutable file attribute on the file.
  3297. Option: ext2-append=<bool>
  3298. Type: BOOL
  3299. Option group: REG
  3300. Phase: FD
  3301. Platforms: all
  3302. Sets the append file attribute on the file.
  3303. Option: ext2-nodump=<bool>
  3304. Aliases: nodump=<bool>
  3305. Type: BOOL
  3306. Option group: REG
  3307. Phase: FD
  3308. Platforms: Linux
  3309. Sets the nodump file attribute on the file.
  3310. Option: ext2-noatime=<bool>
  3311. Type: BOOL
  3312. Option group: REG
  3313. Phase: FD
  3314. Platforms: Linux
  3315. Sets the noatime file attribute on the file.
  3316. Option: ext2-journal-data=<bool>
  3317. Aliases: journal-data=<bool>
  3318. Type: BOOL
  3319. Option group: REG
  3320. Phase: FD
  3321. Platforms: Linux
  3322. Sets the journal-data file attribute on the file.
  3323. Option: ext2-notail=<bool>
  3324. Aliases: notail=<bool>
  3325. Type: BOOL
  3326. Option group: REG
  3327. Phase: FD
  3328. Platforms: none
  3329. Sets the notail file attribute on the file.
  3330. Option: ext2-dirsync=<bool>
  3331. Aliases: dirsync=<bool>
  3332. Type: BOOL
  3333. Option group: REG
  3334. Phase: FD
  3335. Platforms: Linux
  3336. Sets the dirsync file attribute on the file.
  3337. Option: ext2-topdir=<bool>
  3338. Aliases: topdir=<bool>
  3339. Type: BOOL
  3340. Option group: REG
  3341. Phase: FD
  3342. Platforms: Linux
  3343. Sets the topdir file attribute on the file.
  3344. ===============================================================================
  3345. Appendix: generating a sandbox (chroot environment)
  3346. While it is possible to generate a sandbox almost anywhere in the file system,
  3347. I recommend to use a file system that has been mounted with restrictions,
  3348. especially nosuid and maybe nodev, or even ro.
  3349. You may mount a dedicated file system for the sandbox, so it gets a little
  3350. harder for the guests to determine for sure if they are within a sandbox when
  3351. using "ls -id /"
  3352. The following desribes typical steps for generating a sandbox. Depending on
  3353. your operating system, application, and security requirements, your mileage may
  3354. vary. With the below steps, you will be able to run some check programs to play
  3355. around with the sandbox.
  3356. I Installation
  3357. 1) Create a sandbox group - but give it and all following "sandbox" ids a more
  3358. cryptic name!
  3359. 2) Create a sandbox user, only in sandbox group. If this user must never login,
  3360. give it a useless shell like /bin/false
  3361. 3) Check the sandbox home directory (e.g. /home/sandbox) and save and remove
  3362. all .profile, public_html/ etc.
  3363. 4) Optionally mount a new file system over the new home directory
  3364. 5) Generate subdirectories bin, lib, etc, usr, usr/bin, usr/lib.
  3365. Set their permissions and ownership equal to the original directories (or use
  3366. only root.root)
  3367. 6) Generate subdirectory home/sandbox (or similarly; like sandbox home)
  3368. 7) Generate etc/passwd with users sandbox and root, but do not store original
  3369. password hashes there!
  3370. 8) Generate etc/group with only groups sandbox and root (or system on AIX)
  3371. 9) Copy test programs and utilities to bin, e.g. su, id, ls, mount, strace (but
  3372. without SUID/SGID)
  3373. 10) Copy the required shared libraries and the shared library loader to their
  3374. directories.
  3375. On Linux, e.g. /lib/ld-linux.so.2, /lib/libnss_compat.so.2
  3376. Note: it is often difficult to find out what shared libraries are (still) not
  3377. installed in the sandbox. The programs invoked in the sandbox typically do not
  3378. give useful error messages. If chroot's exec call gives an error like "no such
  3379. file or directory", and you do not know if it even found the program itself,
  3380. then remove the test programs execute permission; the error message should
  3381. change to "execute permission denied" or so. Redo the execute permissions and
  3382. look for the shared libraries...
  3383. List required libraries of a program:
  3384. Linux: ldd <program>
  3385. AIX: xdb <program>
  3386. map
  3387. 11) For testing purposes, install id, ls, su, mount, strace, and maybe sh in
  3388. the sandbox. Test it.
  3389. II Customization
  3390. 12) Copy your applications, configuration files, and data to the appropriate
  3391. directories within the sandbox.
  3392. Test function of the application in the sandbox, and add missing files and
  3393. libraries. If an application program gets killed immediately after start, it
  3394. might miss a shared library.
  3395. III Cleanup, check
  3396. 13) Implement your own tricks how to improve security of the sandbox
  3397. 14) Remove test programs like bin/sh, id, ls, mount, strace
  3398. ===============================================================================
  3399. socket types, modes and their security features:
  3400. IP.v4.TCP.connect
  3401. IP.v4.TCP.listen range tcpwrap srcport lowport
  3402. IP.v4.UDP.connect
  3403. IP.v4.UDP.listen range tcpwrap srcport lowport
  3404. IP.v4.UDP.sendto
  3405. IP.v4.UDP.recvfrom range tcpwrap srcport lowport
  3406. IP.v4.UDP.recv range tcpwrap srcport lowport
  3407. IP.v4.raw.sendto
  3408. IP.v4.raw.recvfrom range tcpwrap
  3409. IP.v4.raw.recv range tcpwrap
  3410. IP.v6.TCP.connect
  3411. IP.v6.TCP.listen range tcpwrap srcport lowport
  3412. IP.v6.UDP.connect
  3413. IP.v6.UDP.listen range tcpwrap srcport lowport
  3414. IP.v6.UDP.sendto
  3415. IP.v6.UDP.recvfrom range tcpwrap srcport lowport
  3416. IP.v6.UDP.recv range tcpwrap srcport lowport
  3417. IP.v6.raw.sendto
  3418. IP.v6.raw.recvfrom range tcpwrap
  3419. IP.v6.raw.recv srcport lowport
  3420. UNIX.stream.connect
  3421. UNIX.stream.listen
  3422. UNIX.dgram.sendto
  3423. UNIX.dgram.recvfrom
  3424. UNIX.dgram.recv
  3425. OPENSSL.connect
  3426. OPENSSL.TCP4.listen range tcpwrap srcport lowport
  3427. OPENSSL.TCP6.listen range tcpwrap srcport lowport
  3428. ===============================================================================
  3429. Missing features and Caveats:
  3430. . no support for SIGIO mechanism
  3431. . no support for socket ancillary messages
  3432. . Probably many ioctls not implemented due to missing documentation
  3433. . only limited implementation of raw sockets and interfaces,
  3434. . no support for high level sockets beyond UNIX, INET, and INET6 domains