If you do not want a professional to treat the infestation and rather eradicate them yourself you risk not killing the whole colony. If the beam to be treated is still sound and not damaged you should treat it by Drilling several 1/4 inch holes, applying any liquid termite repellent made for wood into the holes until they are full.
Tell-tale of carpenter ants would be sawdust on floor or surroundings of the tunnels. Carpenter ants do not eat wood; hence, when they bore tunnels through wood, they push out the bits of wood through the holes in the wood which then accumulate in piles.
In the photographs appear to be the typical termite mud tunnels. Termites consume wood and then cover their tunnels with saliva, mud, and fecal matter. The dirt trails you see are called “mud tunnels.”
Best Answer
I believe this is the Pyrrharctia Isabella, or woollybear. Thuricide1 is labelled as a catepillar control pesticide.
1 Home Depot link, no endorsement as I have never used this myself