Dynamic IP address allocation for sliplogin

I was setting up SLIP access for our Internet provider site, and decided 
that it wasn't reasonable to assign each of our customers one of our 
class C addresses, since we only have 254 available and we could 
concievably have more customers than that. I got to thinking that only 8 
of these addresses could be in use at any given time anyways, since we 
only currently have 8 incoming lines. So I thought to myself, "Self, why 
not just assign the IP address based on the incoming tty?". I thought 
about it, pronounced it a good idea, congratulated myself and then went 
and coded it. Its nothing particularly difficult. I just stuck a section 
of code in that checks to see if the IP address retrieved from slip.hosts 
is "DYNAMIC" or "*", if so, it grabs the tty name with ttyname(), and 
looks that up in /etc/slip.tty and grabs the IP address from there. 

Setting up:
1) Compile and install the new sliplogin.
2) Create (or copy example) /etc/slip.tty.
3) Edit /etc/slip.tty for your tty's and IP's.
4) Create a method of running sliplogin.

Number 4 is the trickiest. I'll tell you what I did and you can modify as 
needed. The typical method (I think) is to create slip accounts for users 
(say Sestern instead of estern, which gets into the UNIX shell account) 
and just use sliplogin as the shell account. This is all well and good, 
but I wanted my users to log in the same each time, no matter if they 
were going to be using UNIX shell, SLIP or PPP. Most of them use bash as 
well. So I created an alias (go_slip="exec /sbin/sliplogin"). Their SLIP 
program should log them in (name and password) then send the "go_slip" 
command, which runs sliplogin as a replacement for the shell (thats what 
exec does). This is IMPORTANT because otherwise the shell remains the 
session leader, and it will get the hangup signal when the user hangs up, 
and not sliplogin. Therefore, sliplogin never releases the line and it 
becomes unusable until manually reset! If your users use a shell that 
doesn't have "exec" (most of them do), you'll have to find another way 
around the problem.

Anyways, that about wraps it up. If you've any problems/questions/etc 
just email at estern@mgl.worldlinx.com.
