Sending data over ppp
I am currently doing a project to transfer data over ppp link in linux and want some valuable help to proceed. I am presenting the whole scenario here. I have a Linux Dial-in ppp server into which many computers running win xp and linux dials in. I have set up the linux box to act as a dial-in server. Each computer which dial-up this server have different username and password. In the Linux server one directory is maintained for each dial-in username both under a "send" and a "receive" directory. Whenever the connection is established from a computer say XXX to the server a program will run at the server which will send all files in the directory "/send/XXX" and at the other end the files will be received by the computer XXX in its receive directory. I have somehow able to write the C program which will take care of data transfer but the problem is that I have no way to figure out which user has logged in so that I can send data from the appropiate directory. I have called the C program in the "/etc/ppp/ip-up" script which is executed by the pppd each time the connection is established. I have heard that the username is recorded in wtmp system file but it will be helpful for me if somehow show the way to get the username after he has logged in so that I can pass it as a command line argument to the data transfer program.
Thanks in advance