1 |
sbriesen 08/09/23 19:34:01 |
2 |
|
3 |
Added: ttyd.initd termnetd.confd |
4 |
termpkg-3.3-ttydforfax.diff termnetd.initd |
5 |
ttyd.confd termpkg-3.3.9.1-gcc43.diff |
6 |
Log: |
7 |
initial commit. |
8 |
(Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 net-misc/termpkg/files/ttyd.initd |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/ttyd.initd?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/ttyd.initd?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: ttyd.initd |
17 |
=================================================================== |
18 |
#!/sbin/runscript |
19 |
# Copyright 1999-2008 Gentoo Foundation |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/files/ttyd.initd,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ |
22 |
|
23 |
description="Remote Modem Utility (${RC_SVCNAME#*.})" |
24 |
command="/usr/sbin/ttyd" |
25 |
|
26 |
depend() { |
27 |
use logger |
28 |
need net |
29 |
} |
30 |
|
31 |
config_check() { |
32 |
# sanitize PTY/TTY names |
33 |
DEV_PTY="/dev/${PTY/\/dev\/}" |
34 |
DEV_TTY="${DEV_PTY/\/pty//tty}" |
35 |
|
36 |
# create command args |
37 |
command_args="-d ${DEV_PTY}" |
38 |
[ -n "${BAUDRATE}" ] && command_args="${command_args} -b ${BAUDRATE}" |
39 |
[ -n "${PORT_SETTINGS}" ] && command_args="${command_args} -p ${PORT_SETTINGS}" |
40 |
command_args="${command_args} ${HOST} ${PORT}" |
41 |
} |
42 |
|
43 |
device_check() { |
44 |
if [ ! -e "${DEV_PTY}" ]; then |
45 |
eerror "PTY doesn't exist: ${DEV_PTY}" |
46 |
return 1 |
47 |
fi |
48 |
if [ ! -e "${DEV_TTY}" ]; then |
49 |
eerror "TTY doesn't exist: ${DEV_TTY}" |
50 |
return 1 |
51 |
fi |
52 |
return 0 |
53 |
} |
54 |
|
55 |
linkrel() { # <from> <to> |
56 |
local LINK="${1%/*}/${2/\/dev\/}" |
57 |
echo "${LINK/\/dev\/}" | sed "s:[^/]\+/:../:g" |
58 |
} |
59 |
|
60 |
setup_links() { |
61 |
local LINK NODE |
62 |
for LINK in ${SYMLINK}; do |
63 |
NODE="/dev/${LINK/\/dev\/}" |
64 |
mkdir -p -- "${NODE%/*}" && ln -snf -- $(linkrel "${NODE}" "${DEV_TTY}") "${NODE}" |
65 |
done |
66 |
for LINK in ${HARDLINK}; do |
67 |
NODE="/dev/${LINK/\/dev\/}" |
68 |
mkdir -p -- "${NODE%/*}" && ln -nf -- "${DEV_TTY}" "${NODE}" |
69 |
done |
70 |
} |
71 |
|
72 |
unset_links() { |
73 |
local LINK LIST="" |
74 |
for LINK in ${SYMLINK} ${HARDLINK}; do |
75 |
LIST="${LIST} /dev/${LINK/\/dev\/}" |
76 |
done |
77 |
[ -n "${LIST}" ] && rm -f -- ${LIST} |
78 |
} |
79 |
|
80 |
setup_perms() { |
81 |
[ -n "${MODE}" ] && chmod "${MODE}" -- "${DEV_TTY}" |
82 |
[ -n "${USER}" ] && chown "${USER}" -- "${DEV_TTY}" |
83 |
} |
84 |
|
85 |
unset_perms() { |
86 |
[ -n "${USER}" ] && chown --reference "${DEV_PTY}" -- "${DEV_TTY}" |
87 |
[ -n "${MODE}" ] && chmod --reference "${DEV_PTY}" -- "${DEV_TTY}" |
88 |
} |
89 |
|
90 |
start() { |
91 |
config_check || return ${?} |
92 |
device_check || return ${?} |
93 |
ebegin "Starting ${description}" |
94 |
start-stop-daemon --start --quiet --exec "${command}" -- ${command_args} |
95 |
if eend ${?}; then |
96 |
setup_perms |
97 |
setup_links |
98 |
return 0 # from here we never fail |
99 |
fi |
100 |
} |
101 |
|
102 |
stop() { |
103 |
config_check || return ${?} |
104 |
# we can't use start-stop-daemon, because we don't have a pidfile |
105 |
# *and* multiple processes can run at the same time. So we use |
106 |
# pkill to identify *our* process via commandline args. |
107 |
ebegin "Stopping ${description}" |
108 |
/usr/bin/pkill -f "^${command} -d ${DEV_PTY} " |
109 |
eend ${?} |
110 |
unset_links |
111 |
unset_perms |
112 |
return 0 # never fail |
113 |
} |
114 |
|
115 |
|
116 |
|
117 |
1.1 net-misc/termpkg/files/termnetd.confd |
118 |
|
119 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termnetd.confd?rev=1.1&view=markup |
120 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termnetd.confd?rev=1.1&content-type=text/plain |
121 |
|
122 |
Index: termnetd.confd |
123 |
=================================================================== |
124 |
# Config file for /etc/init.d/termnetd |
125 |
|
126 |
# Set the configuration file to one other than the default of /etc/termnetd.conf |
127 |
# |
128 |
#CONFIG_FILE="/etc/termnetd.conf" |
129 |
|
130 |
# Sets the IP port to listen to for the control port (default = none). |
131 |
# |
132 |
#CONTROL_PORT="" |
133 |
|
134 |
# see the termnetd(1) manual page for additional options you can configure here |
135 |
# |
136 |
#EXTRA_OPTS="" |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
1.1 net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff |
142 |
|
143 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff?rev=1.1&view=markup |
144 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termpkg-3.3-ttydforfax.diff?rev=1.1&content-type=text/plain |
145 |
|
146 |
Index: termpkg-3.3-ttydforfax.diff |
147 |
=================================================================== |
148 |
--- termpkg-3.3/termnet/ttyd.c.orig 2005-09-29 08:59:05.000000000 -1000 |
149 |
+++ termpkg-3.3/termnet/ttyd.c 2005-09-29 08:51:33.000000000 -1000 |
150 |
@@ -340,7 +340,10 @@ |
151 |
char *cp; |
152 |
int x; |
153 |
for (cp = commbuf, x = 0; x < cnt; x++, cp++) |
154 |
+if (isprint(*cp)) |
155 |
syslog(LOG_DEBUG, "ttyd: Have net char 0x%x, |%c|", *cp, *cp); |
156 |
+else |
157 |
+syslog(LOG_DEBUG, "ttyd: Have net char 0x%x", *cp); |
158 |
} |
159 |
write(fd, commbuf, cnt); |
160 |
} |
161 |
@@ -366,9 +369,13 @@ |
162 |
char *cp; |
163 |
int x; |
164 |
for (cp = commbuf, x = 0; x < cnt; x++, cp++) |
165 |
+if (isprint(*cp)) |
166 |
syslog(LOG_DEBUG, "ttyd: Have key char 0x%x, |%c|", *cp, *cp); |
167 |
+else |
168 |
+syslog(LOG_DEBUG, "ttyd: Have key char 0x%x", *cp); |
169 |
} |
170 |
- inputTerminal(commbuf, cnt); |
171 |
+// inputTerminal(commbuf, cnt); |
172 |
+write(fileno(tnlout), commbuf, cnt); |
173 |
} |
174 |
else |
175 |
break; |
176 |
|
177 |
|
178 |
|
179 |
1.1 net-misc/termpkg/files/termnetd.initd |
180 |
|
181 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termnetd.initd?rev=1.1&view=markup |
182 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termnetd.initd?rev=1.1&content-type=text/plain |
183 |
|
184 |
Index: termnetd.initd |
185 |
=================================================================== |
186 |
#!/sbin/runscript |
187 |
# Copyright 1999-2008 Gentoo Foundation |
188 |
# Distributed under the terms of the GNU General Public License v2 |
189 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/termpkg/files/termnetd.initd,v 1.1 2008/09/23 19:34:00 sbriesen Exp $ |
190 |
|
191 |
description="Terminal Server daemon (${RC_SVCNAME#*.})" |
192 |
description_reload="Reread configuration file and make the appropriate changes" |
193 |
extra_started_commands="reload" |
194 |
command="/usr/sbin/termnetd" |
195 |
name="termnetd" |
196 |
|
197 |
depend() { |
198 |
use logger |
199 |
need net |
200 |
} |
201 |
|
202 |
config_check() { |
203 |
command_args="${EXTRA_OPTS}" |
204 |
CONFIG_FILE_DEFAULT="/etc/termnetd.conf" |
205 |
|
206 |
[ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}" |
207 |
[ -n "${CONTROL_PORT}" ] && command_args="${command_args} -s ${CONTROL_PORT}" |
208 |
[ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}" |
209 |
|
210 |
if [ ! -f "${CONFIG_FILE}" ]; then |
211 |
eerror "Please create ${CONFIG_FILE}" |
212 |
eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist" |
213 |
return 1 |
214 |
fi |
215 |
return 0 |
216 |
} |
217 |
|
218 |
start() { |
219 |
config_check || return ${?} |
220 |
ebegin "Starting ${description}" |
221 |
start-stop-daemon --start --quiet --exec "${command}" -- ${command_args} |
222 |
eend ${?} |
223 |
} |
224 |
|
225 |
stop() { |
226 |
ebegin "Stopping ${description}" |
227 |
start-stop-daemon --stop --quiet --oknodo --exec "${command}" --name "${name}" |
228 |
eend ${?} |
229 |
} |
230 |
|
231 |
reload() { |
232 |
ebegin "Reloading ${description}" |
233 |
start-stop-daemon --stop --signal HUP --oknodo --exec "${command}" --name "${name}" |
234 |
eend ${?} |
235 |
} |
236 |
|
237 |
|
238 |
|
239 |
1.1 net-misc/termpkg/files/ttyd.confd |
240 |
|
241 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/ttyd.confd?rev=1.1&view=markup |
242 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/ttyd.confd?rev=1.1&content-type=text/plain |
243 |
|
244 |
Index: ttyd.confd |
245 |
=================================================================== |
246 |
# Configfile for /etc/init.d/ttyd |
247 |
|
248 |
# HINT: if you only need one virtual TTY, then you can use this config. |
249 |
# Otherwise you should use it as a template for specific configurations. |
250 |
# Just copy /etc/conf.d/ttyd to /etc/conf.d/ttyd.<foo> and symlink |
251 |
# /etc/init.d/ttyd to /etc/init.d/ttyd.<foo> |
252 |
|
253 |
|
254 |
# Master pseudo tty device to open and wait for a connection on. |
255 |
# For reference, in Linux the master pseudo tty devices are the |
256 |
# devices /dev/pty[a-ep-z][0-9a-f] and the slave devices are |
257 |
# /dev/tty[a-ep-z][0-9a-f]. |
258 |
# |
259 |
PTY="/dev/ptyp0" |
260 |
|
261 |
# The host and port parameters specify the host and IP port to |
262 |
# connect to when the slave pseudo device is opened. |
263 |
# |
264 |
HOST="host.example.com" |
265 |
PORT=3000 |
266 |
|
267 |
# The optional mode and user options specify the filesystem |
268 |
# permissions of the slave pseudo device. We set them right |
269 |
# after the ttyd daemon has started. After stopping, we reset |
270 |
# them to the permissions of the master pseudo device. |
271 |
# |
272 |
#MODE=660 |
273 |
#USER="root:uucp" |
274 |
|
275 |
# Sets the initial baud-rate of the device (optional). |
276 |
# |
277 |
#BAUDRATE=115200 |
278 |
|
279 |
# Optional port settings. Specified by a string of one of |
280 |
# more of the following concatenated together with no |
281 |
# intervening spaces: |
282 |
# |
283 |
# 8: 8 bits/character |
284 |
# 7: 7 bits/character |
285 |
# 6: 6 bits/character |
286 |
# 5: 5 bits/character |
287 |
# N: No parity |
288 |
# E: Even parity |
289 |
# O: Odd parity |
290 |
# C0: No hardware flow control |
291 |
# C1: Hardware flow control |
292 |
# S0: No software flow control |
293 |
# S1: Software flow control |
294 |
# |
295 |
#PORT_SETTINGS="8NC0" |
296 |
|
297 |
# You can create symlinks to the slave pseudo device, so you |
298 |
# have an easy to remember name for your virtual device. You |
299 |
# can add as many links as you want, if you blank-seperate the |
300 |
# names. All links *must* be relative and beneath to /dev. |
301 |
# |
302 |
#SYMLINK="ttyd/modem ttyNET0" |
303 |
|
304 |
# Some odd programs just don't work with symlinks, so you |
305 |
# can also create hardlinks (even in addition to symlinks). |
306 |
# Same rules apply as for symlinks. |
307 |
# |
308 |
#HARDLINK="ttyS5" |
309 |
|
310 |
|
311 |
|
312 |
1.1 net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff |
313 |
|
314 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff?rev=1.1&view=markup |
315 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/termpkg/files/termpkg-3.3.9.1-gcc43.diff?rev=1.1&content-type=text/plain |
316 |
|
317 |
Index: termpkg-3.3.9.1-gcc43.diff |
318 |
=================================================================== |
319 |
diff -Naur termpkg-3.3.orig/libtn/SocketIO.c termpkg-3.3/libtn/SocketIO.c |
320 |
--- termpkg-3.3.orig/libtn/SocketIO.c 2008-09-03 18:21:28.881220673 +0200 |
321 |
+++ termpkg-3.3/libtn/SocketIO.c 2008-09-03 18:23:29.106343243 +0200 |
322 |
@@ -25,6 +25,7 @@ |
323 |
#endif |
324 |
#include <sys/socket.h> |
325 |
#include <netinet/in.h> |
326 |
+#include <arpa/inet.h> |
327 |
#include <fcntl.h> |
328 |
#include <string.h> |
329 |
#include <stdlib.h> |