Confd-6.3 missing maapi_start_user_session() in libconfd

Hi,

I’m trying to upgrade my code from Confd 5.4 to Confd 6.3 for linux powerpc.
The package for confd-basic-6.3.linux.powerpc contains “confd-basic-6.3.libconfd.tar.gz”. I use this libconfd to rebuild it for my openssl version 0.9.8.

A build of this libconfd compiles fine but my application fails to link with it because some maapi API calls are missing e.g
maapi_start_user_session() is missing
maapi_start_trans() is missing

and they are missing from libconfd/src/maapi.c file as well.
This is not the case with Confd-basic 5.4 package.

Need help to figure what am I missing?
Thanks

Hi,

Your application likely fail to link since you need to include the confd_maapi.h header file with your C-application.
The maapi_start_user_session() and maapi_start_trans() are #define directive macros.
See $CONFD_DIR/include/confd_maapi.h for details.

Learn more about macros for example here:
https://gcc.gnu.org/onlinedocs/cpp/Macros.html

The issue here seems a bit more than just not including the right file!
The definitions are different between 5.4 and 6.3 ( #define vs extern )

> 5.4 -> $CONFD_DIR/include/confd_maapi.h

    > extern int maapi_start_user_session(int sock,
    >                                     const char *username,
    >                                     const char *context,
    >                                     const char **groups, int numgroups,
    >                                     const struct confd_ip *src_addr,
    >                                     enum confd_proto prot);

  
  > 6.3 -> $CONFD_DIR/include/confd_maapi.h

    > #define maapi_start_user_session(s, user, ctx, groups, n, addr, prot) \
    >     maapi_start_user_session3(s, user, ctx, groups, n, addr, 0, prot, \
    >                               NULL, NULL, NULL, __MAAPI_CLIENT_ID__)

Thanks for help. I was able to find the source of my linking error - I had a bad mix of old and new in my own build environment.