da_listener.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright [2021] JD.com, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef DA_LISTENER_H_
  17. #define DA_LISTENER_H_
  18. #include "da_util.h"
  19. #include <sys/socket.h>
  20. #include <sys/un.h>
  21. #include <unistd.h>
  22. struct conn;
  23. struct context;
  24. void listener_ref(struct conn *l, void *owner);
  25. void listener_unref(struct conn *l);
  26. void listener_close(struct context *ctx, struct conn *l);
  27. int listener_each_init(void *elem, void *data);
  28. int listener_each_deinit(void *elem, void *data);
  29. int listener_init(struct context *ctx);
  30. void listener_deinit(struct context *ctx);
  31. int listener_recv(struct context *ctx, struct conn *conn);
  32. #endif /* DA_LISTENER_H_ */