Switch's IP and MAC address

Hello,
As part of my project, I am working on a load balancer with 2 switches in the topology (JSON file). I followed the tutorials, and I found hosts broadcasting to send a packet from one host to another via the ports on the switch.
I’m using bmv2 just like in the tutorials.
In my implementation, however, I want to send the packets on switch 1 when I initiate a packet. Is it possible to have static IP and MAC addresses for the switches in the topology json the way hosts have them? I want to use the static MAC address of the switch when sending a packet.

I’m not sure if this will disrupt the setup in the tutorials exercise folder because in the run_exercie.py , I see for link in host_links:
host_name = link[‘node1’]
sw_name, sw_port = self.parse_switch_node(link[‘node2’])
host_ip = hosts[host_name][‘ip’]
host_mac = hosts[host_name][‘mac’]
self.addHost(host_name, ip=host_ip, mac=host_mac)
self.addLink(host_name, sw_name,
delay=link[‘latency’], bw=link[‘bandwidth’],
port2=sw_port)

    for link in switch_links:
        sw1_name, sw1_port = self.parse_switch_node(link['node1'])
        sw2_name, sw2_port = self.parse_switch_node(link['node2'])
        self.addLink(sw1_name, sw2_name,
                    port1=sw1_port, port2=sw2_port,
                    delay=link['latency'], bw=link['bandwidth']).

Thanks a lot in advance!

I only have a lead to a possible answer for you, not a detailed answer.

(a) It is possible to write P4 programs that run on a switch where the concept of the switch having a static IP address (or even more than one) or a static MAC address (or more than one) make sense.

(b) It is also possible to write P4 programs that run on a switch where it is not applicable to say that the switch has a static IP address, or a static MAC address, even though the switch is programmed with the concept of Ethernet and IPv4 headers.

(c) Finally, it is possible to write a P4 program that runs on a switch where the concept of Ethernet and IPv4 are not applicable.

Sorry, I do not know whether the P4 program you are thinking about fits into category (a) or (b). i am pretty sure it does not belong in category (c).