Jump to main content

##

# TCPIP_STACK_NetAddressMacSet Function

## C

    bool TCPIP_STACK_NetAddressMacSet(
        TCPIP_NET_HANDLE netH,
        const TCPIP_MAC_ADDR* pAddr
    );

## Description

This function sets the network interface physical MAC address.

## Preconditions

The TCPIP_STACK_Initialize() function must have been called before calling this function. The network interface should be up and running.

## Parameters

Parameters | Description
--- | ---
netH | Interface handle to set the address of.
pAddr | Pointer to a valid physical (MAC) address.

## Returns

- True - If the MAC address of the interface is set.
- False - If no such interface or interface is not enabled.

## Remarks

One should use extreme caution when using these functions to change the settings of a running network interface. Chaning these parameters at runtime can lead to unexpected behavior or loss of network connectivity. The preferred way to change the parameters for a running interface is to do so as part of the neetwork configuration passed at the stack initialization.

This function updates the MAC address in the stack data structures. It does not re-program the MAC with the new address. The MAC programming is done only at MAC intialization.

## Example

    TCPIP_NET_HANDLE netH = TCPIP_STACK_NetHandleGet("PIC32INT");
    TCPIP_STACK_NetAddressMacSet(netH, &myMacAddress);