rtp_abp.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "prog2.h"
  4. extern int nsimmax;
  5. extern float lambda;
  6. /* The following routine will be called once (only) before any other */
  7. /* entity A routines are called. You can use it to do any initialization */
  8. void A_init() {
  9. }
  10. /* called from layer 3, when a packet arrives for layer 4 */
  11. void A_input( pkt_t packet ) {
  12. }
  13. /* called from layer 5, passed the data to be sent to other side */
  14. void A_output( msg_t message ) {
  15. }
  16. /* called when A's timer goes off */
  17. void A_timerinterrupt() {
  18. }
  19. /* the following rouytine will be called once (only) before any other */
  20. /* entity B routines are called. You can use it to do any initialization */
  21. void B_init() {
  22. }
  23. /* called from layer 3, when a packet arrives for layer 4 at B*/
  24. void B_input( pkt_t packet ) {
  25. }
  26. /* Note that with simplex transfer from a-to-B, there is no B_output() */
  27. void B_output( msg_t message ) {
  28. /* need be completed only for extra credit */
  29. }
  30. /* called when B's timer goes off */
  31. void B_timerinterrupt() {
  32. }