remove chainguard (?) lockring on fixed cup bracket I'm trying to remove the part of the frame that was holding the chainguard but there seems to be a kind lockring and I don't know which tool to use. Any ideas?

EDIT: I am referring to the topmost six-edge nut, NOT the lockring (I do have a C spanner for that.)

EDIT: I've accepted ojs's answer: the six-notch cup is the fixed part of the cup, it's not supposed to be removed at all unless the bottom bracket is completely replaced (and that was not my goal); the lockring is supposed to be removed without removing the cup. I took the bike to a mechanic who pointed out that this is a reverse-threaded cup, which I knew, however since the cup is reverse-threaded so is the lockring (it cannot be otherwise). The whole lot was seized and rusty (the mechanic had to hammer it a lot). Apparently I made things much worse but tightening it further while trying to unscrew it. Lessons learned.
The tool is called lock ring wrench, or in non-bike contexts hook wrench or hook spanner. There are a few different sizes, measure the lock ring before buying one.

EDIT: The inner part is locked by the lock ring. Once the ring is loose, the inner part should be finger tight. If it's stuck, penetrating oil and pipe wrench or the pin spanner from other answer should help.