Swelling at the anal entrance. Is this some sort of infection?

Possibly. Swelling adjacent to the anus may be in infection of the perineal gland. These glands are located near the anus and can become infected with local bacteria. They may require surgery to treat definitively.
Need Exam... Swelling in and around the anus most likely is caused by hemorrhoids. Infection or std is possible but less likely. Suggest seeing a doctor for an exam to determine what is going on so you can treat it properly.