Do you happen to know the divergence of p, and the projection of p onto the outward pointing normal vector of the boundary of the volume you're solving for p in?
In general, if you know
[tex]\nabla \times \mathbf{u} = \mathbf{C}(\mathbf{r})[/tex]
[tex]\nabla \cdot \mathbf{u} = s(\mathbf{r})[/tex]
and the value of [itex]\mathbf{\hat{n}}\cdot \mathbf{u}[/itex] on the boundary of the volume you're solving in, [itex]\partial V[/itex], then there is a unique solution for [itex]\mathbf{u}[/itex]. Writing
[tex]\mathbf{u} = -\nabla \phi + \nabla \times \mahtbf{A}[/tex],
then
[tex]\phi(\mathbf{r}) = \frac{1}{4\pi}\int d^3\mathbf{r'} \frac{s(\mathbf{r}')}{|\mathbf{r}-\mathbf{r}'|} + \mbox{const.}[/tex]
[tex]\mathbf{A}(\mathbf{r}) = \frac{1}{4\pi}\int d^3\mathbf{r'} \frac{\mathbf{C}(\mathbf{r}')}{|\mathbf{r}-\mathbf{r}'|} + \nabla f(\mathbf{r})[/tex]