C# 클래스 Ipop.Ethernet

Provides an interface to the Virtual Network device known as a TAP device. Ethernet is an ISender, meaning to write to the device, one must call the Send method. It is also an ISource, meaning to receive packets one must subscribe via the Subscribe method to the output.
상속: SimpleSource, ISender
파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Address MemBlock

보호된 프로퍼티들

프로퍼티 타입 설명
_read_thread Thread
_running bool
_send_buffer byte[]
_tap Ipop.Tap.TapDevice

공개 메소드들

메소드 설명
Ethernet ( string device_name ) : Brunet

Initializes the Ethernet device by opening the TAP device and starting the ISource thread.

Send ( ICopyable data ) : void

Writes the data to the Ethernet device.

The same max MTU byte array is always used to write the data to the device. Since the incoming data is an ICopyable, it needs to be copied to a single byte array before being sent to the unmanaged language.

Stop ( ) : void

Call this method when exiting to stop the _read_thread.

ToUri ( ) : String

보호된 메소드들

메소드 설명
ReadLoop ( ) : void

The thread acting as the ISource for Ethernet, this is where reading of the TAP is performed. Use Subscribe to receive the packets coming from here.

The same max MTU byte array is always read into. This is then copied to a minimum sized MemBlock and send to the subscriber.

메소드 상세

Ethernet() 공개 메소드

Initializes the Ethernet device by opening the TAP device and starting the ISource thread.
public Ethernet ( string device_name ) : Brunet
device_name string
리턴 Brunet

ReadLoop() 보호된 메소드

The thread acting as the ISource for Ethernet, this is where reading of the TAP is performed. Use Subscribe to receive the packets coming from here.
The same max MTU byte array is always read into. This is then copied to a minimum sized MemBlock and send to the subscriber.
protected ReadLoop ( ) : void
리턴 void

Send() 공개 메소드

Writes the data to the Ethernet device.
The same max MTU byte array is always used to write the data to the device. Since the incoming data is an ICopyable, it needs to be copied to a single byte array before being sent to the unmanaged language.
public Send ( ICopyable data ) : void
data ICopyable ICopyable of the data to be written.
리턴 void

Stop() 공개 메소드

Call this method when exiting to stop the _read_thread.
public Stop ( ) : void
리턴 void

ToUri() 공개 메소드

public ToUri ( ) : String
리턴 String

프로퍼티 상세

Address 공개적으로 프로퍼티

The address of our TapDevice
public MemBlock Address
리턴 MemBlock

_read_thread 보호되어 있는 프로퍼티

The thread that provides the ISource for Ethernet
protected Thread _read_thread
리턴 Thread

_running 보호되어 있는 프로퍼티

Set to false when we're exiting
protected bool _running
리턴 bool

_send_buffer 보호되어 있는 프로퍼티

This is a constant buffer used for writing to the tap device
protected byte[] _send_buffer
리턴 byte[]

_tap 보호되어 있는 프로퍼티

protected TapDevice,Ipop.Tap _tap
리턴 Ipop.Tap.TapDevice