Ospf special advertise

Hello,
Is it possible to specify which networks can be advertised in OSPF? I mean whether they are learned or connected.

For example: We have Router A connected to Router B, and Router B connected to Router C.
Without using any redistribution, we know that the networks defined in Router A’s interface-template will be learned by Router B, which in turn will teach them to Router C.
What I want is for Router B to learn these networks, but not advertise them to Router C, just which i want.
I tried using routing filtering as below, but it didn’t work.

/routing filter rule
add chain=specific-adv disabled=no rule=“if (dst in 172.25.0.3) {accept} else { reject}”

/routing ospf instance
add disabled=no name=tm-instance-0 out-filter-chain=specific-adv router-id=172.1.0.200

output can filter only external LSAs, but you can filter any LSA on input.