You are likely looking for something like gDLL->getFAStarIFace()->GeneratePath(). This is tricky stuff as the most interesting part takes place inside the exe and I haven't been able to find any documentation on it.
The best I can do is give you code, which I wrote and is known to work. It is written for Medieval Conquest (a colonization mod, but it should work in BTS too). The goal is to check if two plots are connected by road.
Code:
if (gDLL->getFAStarIFace()->GeneratePath(&GC.getRouteFinder(), pLastPlot->getX_INLINE(), pLastPlot->getY_INLINE(), pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), false, (0x40 & eTeam), true))
This is true if pLastPlot and pLoopPlot are connected.
The code it calls is:
You should be able to do something similar. The interesting line is marked in
red. It should be true if the civ can pass and false if it can't. You then write a function, which checks if plot is water, impassable, owned by player with/without open borders etc.
There is a bit of bit magic as I didn't manage to add more arguments (I don't think it's possible). Because of this iInfo is both team and mode selector and as such needs to be split.
Look at CvMap::setup() to see which pathfinding functions you have available. The 4th last argument is a pointer to a function in CvGameCoreUtils.cpp.
Come to think of it, maybe you can use one of the existing pathfinding functions without modifying it. I would advice you to take a closer look at all of them before starting any coding.
Warning: pathfinding might have to go through a lot of data meaning it will likely slow down the game if you write code to make hundreds of checks every turn. My profiling experience tells me that pathfinding is a major part of totally time used by the AI. I can't remember precisely offhand, but I recall something about more than 1/3 of total time spent on AI actions. It was on a big map, but still it is something to keep in mind.