mnAddServicePort

This command associates a port with a service.

For more information on profiles see “Firewall Profiles”.

You can use mnDeleteServicePortA or mnDeleteServicePortB to delete service port entries.

Parameters

unsigned int ProfileID: This is the ID of the profile that the command should use.

unsigned int ServiceID: This is the ID of the service that the command should use.

char * Name: This is the name of the port.

int IPVersion: This is the IP version of the port.

0: V4

1: V6

2: V4 and V6

int Protocol: This is the protocol of the port.

17: UDP

6: TCP

long PortNumber: This is the port number of the port.

int Scope: This is the scope of the port.

0: All

1: Local subnet

2: Custom

char * RemoteAddresses: This is the remote addresses of the port.

The string consists of one or more comma-delimited tokens specifying the remote addresses from which the application can listen for traffic. The default value is "*".

Valid tokens:

- "*": any remote address; if present, it must be the only token.

- "LocalSubnet": not case-sensitive; specifying more than once has no effect.

- subnet: may be specified using either subnet mask or network prefix notation. If neither a subnet mask nor a network prefix is specified, the subnet mask defaults to 255.255.255.255. Examples - of valid subnets: 10.0.0.2/255.0.0.0 10.0.0.2/8 10.0.0.2

- Windows Vista: A valid IPv6 address.

- Windows Vista: An IPv4 address range in the format "start address - end address."

- Windows Vista: An IPv6 address range in the format "start address - end address."

bool Enabled: True is the port entry is enabled, false if it is disabled.

Returns (Integer)

0 if no error occurred.

-1 if an error occurred.

Present in

DBP

C++

.Net




This page is in the following sections:
(2) Firewall Services
(1) Windows Firewall
(0) DarkNet Help