This is your homework and you should do it yourself. But I will give you some tips.
Recursive functions are calling themself, but have some stopping logic. The result than you have to provide. This is a plain example
int sumsup(TreeNode *node) {
if( node == 0) return 0;
int left = sumup(node->left);
int right = sumup(node->right);
return left + right;
}
Read the
binary tree example for further information.