Large public congregation of short period such as Kumbh Mela, Hajj, open fairs, outdoor musical concerts etc. require temporary to semi-permanent communication and computation infrastructure to provide IoT based smart services. For these use cases, wireless mesh networks (WMN) present themselves as an elegant underlying communication substrate for designing IoT-based smart infrastructures where the wired network is not a cost-effective solution. Further, the mesh network devices such as wireless routers, access points, and gateways can also be utilized to support in-network computing for installation and execution of microservices dynamically. This paper presents the design and implementation of a software-defined wireless fog infrastructure for IoT-based semi-permanent smart infrastructure. Our proposed controller ”SDFog-Mesh” can be deployed quickly to support in-network computing over wireless network devices. Further, this controller also assists in choosing the fog nodes which are best suited for executing the desired microservice. However, the interesting challenge is to create an execution environment on fog nodes and to redirect the IoT traffic towards the deployed micro-services on-the-fly. The “SDFog-Mesh” architecture utilizes P4 language to insert/delete flow rules dynamically on the fog nodes for different classes of IoT traffic such as IoT to Fog (IF), Fog to Fog (FF), Fog to Cloud (FC) and IoT to Cloud (IC). We have considered MQTT-based IoT application as a demonstrative example to enable IF, FF, FC, and IC communication within a fog environment. The microservices of various QoS classes are deployed over our implemented testbed to evaluate our approach. Our proposed architecture has also been emulated with more devices using Mininet-Wifi for the same microservices classes for evaluating the scalability. We have considered parameters like setup time, flow creation time in data path devices, microservice service time, QoS constraints, and maintenance overhead for evaluation. The gathered results establish the applicability of our proposed solution.