getting mac from ip (or the contrary)

Hi there,
I need to find a way to check that a remote machine got the correct ip address. I have a dhcp server and need to run some commands after machine M acquired address A.
There are lots of reasons why machine M could have another address:
1) DHCP not reloaded
2) Machine M offline or powered off
3) Machine M has not renewed its ip address

Is there a way to do one of the following?

if [$(getmacfromip $ip) == $mac]; then ...
if [$(getipfrommac $mac) == $ip]; then ...

Can you help me lead me in the right direction?
Thanks in advance
Santiago

man arp

Thanks danmero for helping me.
Unfortunately, I can't use arp (command not found). Maybe because I'm not root.
I found this solution though:

[[ -n $(mysql "SELECT id FROM terminal WHERE ip = '$ip' AND mac = '$(ssh root@$ip 'cat /sys/class/net/eth0/address')'") ]] && ...