You can read the carnival policy on their web site..
But basically they allow you to bring one bottle of wine or a 12-pack of soda (or other non-alcoholic drink) per person.
You have to drink it in your stateroom, if you open it outside in a public room you will be charged a corkage fee ($15 or $20).
You cannot bring bottles of booze onboard or buy them onboard for consumption onboard. If you buy liquor in a port of call they will take and hold it for you, returning it to you when you leave the ship. That way you can do your duty-free shopping, you just can't consume it onboard.
However, I have often bought "souvenir" bottles of liquor and brought them onboard - Rum in Jamaica, etc. and not had them confiscated. Generally the security guards at the doors in ports of call don't care to get involved with taking your booze away, just be discrete about it.