sizeof(int)==32ならば、、、
#define SUBNET(bit) (((unsigned)~0)<<(32-(bit)))