What causes the general ill feeling when you're in pain?

What sort of biochemical processes are going on when you’re in pain?

Whenever I have menstrual cramps…I feel nauseous, fatigued, drowsy, and achey in other parts of my body. Sometimes I even feel like I have a fever.

I feel similar whenever I have toothaches.

There was a recent thread on why is nausea a common symptom of illness. The same idea applies in this case really, your nervous system has moved focus from one autonomic system to another, the sensation is general malaise.

http://boards.straightdope.com/sdmb/showthread.php?t=597163&highlight=nausea