B-Bone segments

How can I get segments of B-Bone via python? I want to export the pose and the rest position of that bone.