From the rules (NOTE: 3.5 rules here):
A confused character’s actions are determined by rolling d% at the beginning of his turn: 01-10, attack caster with melee or ranged weapons (or close with caster if attacking is not possible); 11-20, act normally; 21-50, do nothing but babble incoherently; 51-70, flee away from caster at top possible speed; 71-100, attack nearest creature (for this purpose, a familiar counts as part of the subject’s self).
So per the rules, "attack caster" is established as attacking with ranged or melee weapons, or closing with the caster if attacking is not possible. It is reasonable to assume, due to items in a series, that "attack nearest creature" is identical to "attack caster," only with a new target. So, if the roll is 71-100, then the character would:
- Full attack the character with their weapon if possible
- Move to the character and attack
- Move max distance to the character
There is nothing in the confused status that states they use feats, abilities, etc. So RAW is just attacking.
Note that I'm referring to 3.5 rules here because Pathfinder does not specify as clearly. Obviously the effects chosen on the chart use pathfinder's system described here, but I think it is fair to use the 3.5 system to describe what is meant by attack.
That said, the way I've always handled confusion is as a hidden DM roll. I basically don't tell the player when they are confused. They are trying to attack targets they normally would. But I just substitute the nearest creature for whatever target they were trying to hit as-applicable. So once they declare their actions and roll their numbers, then I narrate that they swing at Joe Bob the Brave and cleave him right in the giblets. That way, players attack as they would have already, and I'm not dictating their characters' actions.
The added benefit of this is it allows players who are clever and figure it out the option to somehow try to escape combat. This is the one time that I might force an action from a player. If I roll that they are in an "attack nearest creature" round when they are trying to retreat, I might do something like turn their retreat into a bull rush or overrun attempt instead of a withdrawal.
Nowhere does the confused status effect dictate that it controls a player's resources. It simply dictates that they act in a certain manner. That is why I believe the approach I use is best -- it does not force the players to act strangely, and it does not force the DM to control a player character's actions. Instead, it lets the player act as they normally would, but the target of their action is controlled by the status effect. It really is important with this approach to have both the initial effect as well as the per-round status be hidden rolls made by the DM, though.
Why I recommend hidden DM rolls: Knowledge(arcana) is used to identify spell effects in-place or just cast. There is no reason to tell players "you are confused!" Instead, they either should figure it out by effect or have invested in the appropriate knowledge skill to understand what is happening to them.
Why 3.5 'attack' vs the hidden roll method: As noted, determining that "attack" means "attack with ranged or melee weapon" requires the game to refer to 3.5 rules. While those are certainly at the original root of pathfinder, that explanation of attack was removed when the caster-centric effects of confusion were removed from the game system. Rather than requiring a copy of 3.5 rules to be handy whenever one of these omissions is made by pathfinder, I choose to interpret "attack" as anything that would potentially break a charm effect. So if a player intends to take such an action, I simply retarget/recenter it to the nearest creature, as appropriate. If the player does not intend to make such an action, then I change their action to be the most basic hostile action possible since arbitrarily using abilities is just mean.