What is a Satan attack and IP spoofing?
And how could I programmatically defend the system from these?
I mean "How could I write a program defending from such kind of problems"?

I would appreciate any help.

Thanks !