01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BX<br />

ES:DI<br />

0: FTP Server, 1: Telnet Server, 2: Web Server<br />

Pointer to handler function<br />

Return Value<br />

Comments<br />

Top of list<br />

Index page<br />

AX=0: Success<br />

AX=-1: Invalid Parameter<br />

A connection handler function must be declared in the following manner:<br />

int huge UserConnectionHandler( struct sockaddr_in *sockptr );<br />

The connection handler will be called when a client establishes a connection to the server (FTP, WEB, Telnet). The handler can<br />

read the IP Address and the Port in the sockaddr_in struct . (If desired, the IP address in the sin_addr structure member can be<br />

converted to ASCII using the TCP/IP API_INETTOASCII function.) If the handler returns 0 the connection will be established. If it<br />

returns a nonzero value, the connection will be aborted.<br />

To uninstall a connection handler call this function with a null pointer (ES=DI=0).<br />

Example usage:<br />

The implemented handler function can check the source IP address (Clients IP), compare this IP with an application internal<br />

list of allowed IP addresses. The connection can then be rejected by returning a non-zero value if the source IP is not a<br />

member of the list.<br />

Interrupt 0xA0 service 0x37: Enable/Disable File sharing<br />

Parameters<br />

AH<br />

AL<br />

BX<br />

Enable disable File sharing of Int21h open/create<br />

Must be 0x37.<br />

0: set mode, 1: get mode<br />

0: disable, 1: enable (Sharing mode)<br />

Return Value<br />

Comments<br />

Top of list<br />

AX=0: Success, contains Sharing mode if al=1<br />

AX=-1: Invalid Parameter<br />

By default file sharing is disabled. This has the effect that a file which is opened for write access can't be opened a second time for<br />

read or write access. Also a file which is opened for read access can only be opened for read access a further time.<br />

To avoid this security feature you can enable file sharing. This can also be done with the CHIP.INI entry FILESHARING.<br />

NOTE: Be careful when opening a file multiple times with one or more of the openings done with write access!<br />

Page 100 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!