|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--com.dalsemi.tininet.ppp.PPP
This class implements the Point-to-Point Protocol (PPP), which provides IP packet transport over a serial link. PPP exists as a layer between the IP network-layer and a physical interface. Being a point-to-point protocol, PPP does not distinguish between a client and a server operation. For the purposes of this documentation, a peer which requires a remote peer to authenticate and provides an IP address to the remote peer will be known as a server. A peer which does not require a remote peer to authenticate and uses a server assigned IP address will be know as a client. Many variations exist between these configurations and are not covered in this documentation.
To satisfy the physical interface requirement, user application code must open,
initialize and pass a serial port object to an instance of PPP. After passing
the serial port object to PPP, the user application should not attempt to read
or write operations on the serial port until PPP has signaled a closed event. This
does not preclude the application code from implementing the SerialPortEventListener
interface or from polling the serial port status signals.
An application that creates a PPP object must provide a listener to receive notification
of PPP events. The listener is an instance of a class that implements the PPPEventListener
interface.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Constructor Summary | |
PPP()
Default constructor |
Method Summary | |
void |
addEventListener(PPPEventListener eventListener)
Adds a PPP event listener. |
void |
addInterface(java.lang.String name)
Adds a PPP interface to the network interface table. |
void |
addInterface(java.lang.String name,
int mss,
int timeout)
Adds a PPP interface to the network interface table. |
void |
close()
Invoked to close PPP. |
void |
finish()
Kill the PPP thread and inetrrupt timer thread |
void |
freeNativeInterface()
Free the native interface used by this PPP instance |
void |
freePort()
Free the serial port for use by Java |
byte[] |
getLocalAddress()
Gets the local peers address. |
java.lang.String |
getPrimaryDNS()
Gets the primary DNS address. |
byte[] |
getRemoteAddress()
Gets the remote peers address. |
java.lang.String |
getSecondaryDNS()
Gets the secondary DNS address. |
void |
open()
Invoked to open PPP. |
void |
QueueEvent(ProtocolEvent ev)
Queue event listener interface. |
void |
removeEventListener(PPPEventListener eventListener)
Removes a PPP event listener. |
void |
removeInterface(java.lang.String name)
Removes the named PPP interface from the network interface table. |
void |
run()
Thread run method |
void |
setAuthenticate(boolean authenticate,
boolean strong)
Sets the remote peer authentication option. |
void |
setDefaultInterface(boolean value)
Set new PPP netwrok interface to default interface. |
void |
setLocalAccm(long accm)
The local ACCM will be the logical OR of this value ans the ACCM received from the remote peer. |
void |
setLocalAddress(byte[] localAddr)
Sets the local IP address for this interface. |
void |
setPassive(boolean val)
Sets passive mode option. |
void |
setPassword(java.lang.String password)
Sets the password sent to a remote peer during authentication. |
void |
setRemoteAccm(long accm)
Sets the value of the Asynchronous Control Character Map (ACCM). |
void |
setRemoteAddress(byte[] remoteAddr)
Sets the IP address of the remote peer. |
void |
setUsername(java.lang.String userName)
Sets the user name sent to a remote peer during authentication. |
void |
up(PPPDevice pppDevice)
Invoked when serial channel is ready for PPP traffic. |
void |
up(javax.comm.SerialPort sp)
Invoked when serial channel is ready for PPP traffic. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public PPP()
Method Detail |
public void addEventListener(PPPEventListener eventListener) throws java.util.TooManyListenersException
eventListener
- PPPEventListener objectpublic void removeEventListener(PPPEventListener eventListener)
eventListener
- PPPEventListener objectpublic void up(javax.comm.SerialPort sp)
sp
- SerialPort objectpublic void up(PPPDevice pppDevice)
pppDevice
- PPPDevice objectpublic void close()
public void open()
public void run()
public void QueueEvent(ProtocolEvent ev)
ev
- eventpublic void setPassive(boolean val)
val
- true
for passive mode operationpublic void setLocalAccm(long accm)
accm
- local ACCMsetRemoteAccm()
public void setRemoteAccm(long accm)
accm
- Asynchronous Control Character Map (ACCM)public void setUsername(java.lang.String userName)
userName
- user namepublic void setPassword(java.lang.String password)
password
- user passwordpublic void setLocalAddress(byte[] localAddr)
localAddr
- local IP address, index 0 is MSB of four byte network addresspublic void setRemoteAddress(byte[] remoteAddr)
remoteAddr
- remote IP address, index 0 is MSB of four byte network addresspublic void setAuthenticate(boolean authenticate, boolean strong)
true
this peer will require the remote peer to authenticate before a connection is established.authenticate
- true
if remote peer authentication is requiredstrong
- true
if CHAP authentication is requiredpublic void addInterface(java.lang.String name)
name
- interface namepublic void addInterface(java.lang.String name, int mss, int timeout)
name
- interface namemss
- maximum TCP segment size senttimeout
- initial TCP timeoutpublic void removeInterface(java.lang.String name)
name
- interface namepublic void freePort()
public void freeNativeInterface()
public void finish()
public byte[] getLocalAddress()
public byte[] getRemoteAddress()
public java.lang.String getPrimaryDNS()
public java.lang.String getSecondaryDNS()
public void setDefaultInterface(boolean value)
value
- true for default interface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |