com.esf.net.ppp.service
Class PppPeer

java.lang.Object
  extended by com.esf.net.ppp.service.PppPeer

public class PppPeer
extends java.lang.Object

Defines settings per service provider

Author:
ilya.binshtok

Constructor Summary
PppPeer(java.lang.String peerID)
          default constructor
 
Method Summary
 java.lang.String getApn()
          Reports APN (Access Point Name) of cellular data connection.
 int getAuthType()
          Reports authentication type.
 int getBaudRate()
          Reports baud rate used for PPP
 int getConnect_delay()
          Reports connect delay in milliseconds
 ModemXchangeScript getConnectScript()
          Reports connect script
 java.lang.String getDialString()
          Reports dial string
 ModemXchangeScript getDisconnectScript()
          Reports disconnect script
 java.lang.String getId()
          Reports peer ID
 int getLcp_echo_failure()
          Reports number 'lcp-echo-failure' parameter that is number of unanswered LCP echo requests to presume the peer to be dead.
 int getLcp_echo_interval()
          Reports LCP echo interval in seconds
 java.lang.String getLogfile()
          Reports name of the log file
 java.lang.String getNetworkTechnology()
          Reports network technology.
 java.lang.String getPassword()
          Reports password for authentication
 int getPppUnitNumber()
          Reports PPP unit number
 java.lang.String getProvider()
          Reports service provider
 java.lang.String getUsername()
          Reports user name for authentication
 boolean isAddDefaultRoute()
          Reports 'defaultroute' option
 boolean isAllowBsdCompression()
          Reports if BSD compression is allowed
 boolean isAllowDeflateCompression()
          Reports if 'Deflate' compression is allowed
 boolean isAllowMagic()
          Reports is magic number negotiation is enabled
 boolean isAllowProxyArps()
          Reports if 'proxyarp' option is enabled
 boolean isAllowVanJacobsonConnectionIDCompression()
          Reports if Van Jacobson Connection ID compression is allowed
 boolean isAllowVanJacobsonTcpIpHdrCompression()
          Reports if Van Jacobson TCP/IP header compression is allowed
 boolean isEnabled()
          Reports if PPP is enabled in configuration
 boolean isEnableDebug()
          Reports if connection debugging is enabled
 boolean isLockSerialDevice()
          Reports if PPP daemon is setup to create a lock file
 boolean isPeerMustAuthenticateItself()
          Reports if peer is expected to authenticate itself
 boolean isPeerToSupplyLocalIP()
          Reports if peer is expected to supply local IP address using IPCP negotiation.
 boolean isUseModemControlLines()
          Reports if modem control lines are to be used.
 boolean isUsePeerDns()
          Reports if peer supplied DNS should be used
 boolean isUseRtsCtsFlowControl()
          Reports if RTS/CTS hardware flow control is to be used
 void setAddDefaultRoute(boolean addDefaultRoute)
          Sets 'defaultroute' option
 void setAllowBsdCompression(boolean allowBsdCompression)
          Enable/disable BSD compression
 void setAllowDeflateCompression(boolean allowDeflateCompression)
          Enable/disable 'Deflate' compression
 void setAllowMagic(boolean allowMagic)
          Enable/disable magic number negotiation
 void setAllowProxyArps(boolean allowProxyArps)
          Enable/disable 'proxyarp' option
 void setAllowVanJacobsonConnectionIDCompression(boolean allowVanJacobsonConnectionIDCompression)
          Enable/disable Van Jacobson Connection ID compression
 void setAllowVanJacobsonTcpIpHdrCompression(boolean allowVanJacobsonTcpIpHdrCompression)
          Enable/disable Van Jacobson TCP/IP header compression
 void setApn(java.lang.String apn)
          Sets APN (Access Point Name) for cellular data connection.
 void setAuthType(int authType)
          Sets authentication type
 void setBaudRate(int baudRate)
          Sets baud rate used for PPP
 void setConnect_delay(int connect_delay)
          Sets connect delay
 void setConnectScript(ModemXchangeScript connectScript)
          Sets connect script
 void setDialString(java.lang.String dialString)
          Sets dial string
 void setDisconnectScript(ModemXchangeScript disconnectScript)
          Sets disconnect script
 void setEnabled(boolean enabled)
          Enables/disables PPP
 void setEnableDebug(boolean enableDebug)
          Sets 'enable connection debugging' flag
 void setLcp_echo_failure(int lcp_echo_failure)
          Sets 'lcp-echo-faillure' parameter
 void setLcp_echo_interval(int lcp_echo_interval)
          Sets LCP echo interval
 void setLockSerialDevice(boolean lockSerialDevice)
          Enable/disable lock file
 void setLogfile(java.lang.String logfile)
          Sets the name of the log file
 void setNetworkTechnology(java.lang.String networkTechnology)
          Sets network technology
 void setPassword(java.lang.String password)
          Sets password used for authentication
 void setPeerMustAuthenticateItself(boolean peerMustAuthenticateItself)
          Sets 'peer must authenticate itself' flag
 void setPeerToSupplyLocalIP(boolean peerToSupplyLocalIP)
          Sets whether peer is to supply local IP address or not
 void setPppUnitNumber(int pppUnitNumber)
          Sets PPP unit number
 void setProvider(java.lang.String provider)
          Sets service provider
 void setUseModemControlLines(boolean useModemControlLines)
          Sets 'use modem control lines' flag
 void setUsePeerDns(boolean usePeerDns)
          Sets whether to use peer supplied DNS.
 void setUsername(java.lang.String username)
          Sets user name used for authentication
 void setUseRtsCtsFlowControl(boolean useRtsCtsFlowControl)
          Enable/disable RTS/CTS flow control
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PppPeer

public PppPeer(java.lang.String peerID)
default constructor

Method Detail

getPppUnitNumber

public int getPppUnitNumber()
Reports PPP unit number

Returns:
PPP unit number as int

setPppUnitNumber

public void setPppUnitNumber(int pppUnitNumber)
Sets PPP unit number

Parameters:
pppUnitNumber - as int

getId

public java.lang.String getId()
Reports peer ID

Returns:
peer ID as String

isEnabled

public boolean isEnabled()
Reports if PPP is enabled in configuration

Returns:
boolean
true - PPP is enabled false - PPP is disabled

setEnabled

public void setEnabled(boolean enabled)
Enables/disables PPP

Parameters:
enabled -
true - PPP is enabled false - PPP is disabled

getProvider

public java.lang.String getProvider()
Reports service provider

Returns:
- service provider

setProvider

public void setProvider(java.lang.String provider)
Sets service provider

Parameters:
provider - as String

getNetworkTechnology

public java.lang.String getNetworkTechnology()
Reports network technology. (e.g. evdo, 3G)

Returns:
- network technology

setNetworkTechnology

public void setNetworkTechnology(java.lang.String networkTechnology)
Sets network technology

Parameters:
networkTechnology - as String

getApn

public java.lang.String getApn()
Reports APN (Access Point Name) of cellular data connection.

Returns:
APN

setApn

public void setApn(java.lang.String apn)
Sets APN (Access Point Name) for cellular data connection.

Parameters:
apn - as String

getDialString

public java.lang.String getDialString()
Reports dial string

Returns:
dial string

setDialString

public void setDialString(java.lang.String dialString)
Sets dial string

Parameters:
dialString - such as "atdt555-1212"

getAuthType

public int getAuthType()
Reports authentication type. (e.g. NONE, PAP, CHAP)

Returns:
authentication type

setAuthType

public void setAuthType(int authType)
Sets authentication type

Parameters:
authType - int (NONE, PAP, CHAP) as defined in PppAuthentication

getUsername

public java.lang.String getUsername()
Reports user name for authentication

Returns:
user name

setUsername

public void setUsername(java.lang.String username)
Sets user name used for authentication

Parameters:
username - as String

getPassword

public java.lang.String getPassword()
Reports password for authentication

Returns:
password

setPassword

public void setPassword(java.lang.String password)
Sets password used for authentication

Parameters:
password - as String

getBaudRate

public int getBaudRate()
Reports baud rate used for PPP

Returns:
baud rate

setBaudRate

public void setBaudRate(int baudRate)
Sets baud rate used for PPP

Parameters:
baudRate - on serial port, as int

getLogfile

public java.lang.String getLogfile()
Reports name of the log file

Returns:
name of the log file

setLogfile

public void setLogfile(java.lang.String logfile)
Sets the name of the log file

Parameters:
logfile - as String

getConnectScript

public ModemXchangeScript getConnectScript()
Reports connect script

Returns:
ModemXchangeScript

setConnectScript

public void setConnectScript(ModemXchangeScript connectScript)
Sets connect script

Parameters:
connectScript - as ModemXchangeScript

getDisconnectScript

public ModemXchangeScript getDisconnectScript()
Reports disconnect script

Returns:
ModemXchangeScript

setDisconnectScript

public void setDisconnectScript(ModemXchangeScript disconnectScript)
Sets disconnect script

Parameters:
disconnectScript - as ModemXchangeScript

isAddDefaultRoute

public boolean isAddDefaultRoute()
Reports 'defaultroute' option

Returns:
boolean
true - add default route to the system routing table
false - do not add default route

setAddDefaultRoute

public void setAddDefaultRoute(boolean addDefaultRoute)
Sets 'defaultroute' option

Parameters:
addDefaultRoute -
true - add default route to the system routing table
false - do not add default route

isPeerToSupplyLocalIP

public boolean isPeerToSupplyLocalIP()
Reports if peer is expected to supply local IP address using IPCP negotiation.

Returns:
boolean
true - peer is expected to supply local IP address false - peer is not supplying local IP address

setPeerToSupplyLocalIP

public void setPeerToSupplyLocalIP(boolean peerToSupplyLocalIP)
Sets whether peer is to supply local IP address or not

Parameters:
peerToSupplyLocalIP -
true - peer is expected to supply local IP address false - peer is not supplying local IP address

isUsePeerDns

public boolean isUsePeerDns()
Reports if peer supplied DNS should be used

Returns:
boolean
true - use peer DNS
false - do not use peer DNS

setUsePeerDns

public void setUsePeerDns(boolean usePeerDns)
Sets whether to use peer supplied DNS.

Parameters:
usePeerDns -
true - use peer DNS
false - do not use peer DNS

isAllowProxyArps

public boolean isAllowProxyArps()
Reports if 'proxyarp' option is enabled

Returns:
boolean
true - 'proxyarp' is enabled
false - 'proxyarp' is disabled

setAllowProxyArps

public void setAllowProxyArps(boolean allowProxyArps)
Enable/disable 'proxyarp' option

Parameters:
allowProxyArps -
true - 'proxyarp' is enabled
false - 'proxyarp' is disabled

isAllowVanJacobsonTcpIpHdrCompression

public boolean isAllowVanJacobsonTcpIpHdrCompression()
Reports if Van Jacobson TCP/IP header compression is allowed

Returns:
boolean
true - Van Jacobson TCP/IP header compression is allowed
false - Van Jacobson TCP/IP header compression is not allowed

setAllowVanJacobsonTcpIpHdrCompression

public void setAllowVanJacobsonTcpIpHdrCompression(boolean allowVanJacobsonTcpIpHdrCompression)
Enable/disable Van Jacobson TCP/IP header compression

Parameters:
allowVanJacobsonTcpIpHdrCompression -
true - Van Jacobson TCP/IP header compression is allowed
false - Van Jacobson TCP/IP header compression is not allowed

isAllowVanJacobsonConnectionIDCompression

public boolean isAllowVanJacobsonConnectionIDCompression()
Reports if Van Jacobson Connection ID compression is allowed

Returns:
boolean
true - Van Jacobson Connection ID compression is allowed
false - Van Jacobson Connection ID compression is not allowed

setAllowVanJacobsonConnectionIDCompression

public void setAllowVanJacobsonConnectionIDCompression(boolean allowVanJacobsonConnectionIDCompression)
Enable/disable Van Jacobson Connection ID compression

Parameters:
allowVanJacobsonConnectionIDCompression -
true - Van Jacobson Connection ID compression is allowed
false - Van Jacobson Connection ID compression is not allowed

isAllowBsdCompression

public boolean isAllowBsdCompression()
Reports if BSD compression is allowed

Returns:
boolean
true - BSD compression is allowed
false - BSD compression is not allowed

setAllowBsdCompression

public void setAllowBsdCompression(boolean allowBsdCompression)
Enable/disable BSD compression

Parameters:
allowBsdCompression -
true - BSD compression is allowed
false - BSD compression is not allowed

isAllowDeflateCompression

public boolean isAllowDeflateCompression()
Reports if 'Deflate' compression is allowed

Returns:
boolean
true - 'Deflate' compression is allowed
false - 'Deflate' compression is not allowed

setAllowDeflateCompression

public void setAllowDeflateCompression(boolean allowDeflateCompression)
Enable/disable 'Deflate' compression

Parameters:
allowDeflateCompression -
true - 'Deflate' compression is allowed
false - 'Deflate' compression is not allowed

isAllowMagic

public boolean isAllowMagic()
Reports is magic number negotiation is enabled

Returns:
boolean
true - magic number negotiation is enabled
false - magic number negotiation is disabled

setAllowMagic

public void setAllowMagic(boolean allowMagic)
Enable/disable magic number negotiation

Parameters:
allowMagic -
true - magic number negotiation is enabled
false - magic number negotiation is disabled

getLcp_echo_failure

public int getLcp_echo_failure()
Reports number 'lcp-echo-failure' parameter that is number of unanswered LCP echo requests to presume the peer to be dead.

Returns:
LCP echo failure

setLcp_echo_failure

public void setLcp_echo_failure(int lcp_echo_failure)
Sets 'lcp-echo-faillure' parameter

Parameters:
lcp_echo_failure - number of unanswered LCP echo requests before peer is assumed dead

getLcp_echo_interval

public int getLcp_echo_interval()
Reports LCP echo interval in seconds

Returns:
LCP echo interval

setLcp_echo_interval

public void setLcp_echo_interval(int lcp_echo_interval)
Sets LCP echo interval

Parameters:
lcp_echo_interval - in seconds

isUseRtsCtsFlowControl

public boolean isUseRtsCtsFlowControl()
Reports if RTS/CTS hardware flow control is to be used

Returns:
boolean
true - use RTS/CTS flow control
false - do not use RTS/CTS flow control

setUseRtsCtsFlowControl

public void setUseRtsCtsFlowControl(boolean useRtsCtsFlowControl)
Enable/disable RTS/CTS flow control

Parameters:
useRtsCtsFlowControl -
true - use RTS/CTS flow control
false - do not use RTS/CTS flow control

isLockSerialDevice

public boolean isLockSerialDevice()
Reports if PPP daemon is setup to create a lock file

Returns:
boolean
true - create lock file
false - do not create lock file

setLockSerialDevice

public void setLockSerialDevice(boolean lockSerialDevice)
Enable/disable lock file

Parameters:
lockSerialDevice -
true - create lock file
false - do not create lock file

isUseModemControlLines

public boolean isUseModemControlLines()
Reports if modem control lines are to be used.

Returns:
boolean
true - use modem control lines false - do not use modem control lines

setUseModemControlLines

public void setUseModemControlLines(boolean useModemControlLines)
Sets 'use modem control lines' flag

Parameters:
useModemControlLines -
true - use modem control lines false - do not use modem control lines

isPeerMustAuthenticateItself

public boolean isPeerMustAuthenticateItself()
Reports if peer is expected to authenticate itself

Returns:
boolean
true - peer must authenticate itself false - peer is not required to authenticate itself

setPeerMustAuthenticateItself

public void setPeerMustAuthenticateItself(boolean peerMustAuthenticateItself)
Sets 'peer must authenticate itself' flag

Parameters:
peerMustAuthenticateItself -
true - peer must authenticate itself false - peer is not required to authenticate itself

getConnect_delay

public int getConnect_delay()
Reports connect delay in milliseconds

Returns:
- connect delay

setConnect_delay

public void setConnect_delay(int connect_delay)
Sets connect delay

Parameters:
connect_delay - in milliseconds

isEnableDebug

public boolean isEnableDebug()
Reports if connection debugging is enabled

Returns:
boolean true - connection debugging is enabled
false - connection debugging is not enabled

setEnableDebug

public void setEnableDebug(boolean enableDebug)
Sets 'enable connection debugging' flag

Parameters:
enableDebug - - enable connection debugging