I think , you need the list of DoF boundary.
border C1(t=0,2*pi) {x=cos(t); y=sin(t);label=1;}
mesh Th=buildmesh(C1(6));
fespace Vh(Th,P1);
Vh phi, w;
varf vBord(phi,w) = int1d(Th)(w);
Vh on1=vBord(0,Vh);
for(int i=0; i< Vh.ndof;++i)
if (on1[][i]>0)
cout << i << " " << endl;