Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

  1. /* Definitions for the SMTP commands
  2. SMTP commands can be added, and deleted by editing the header file
  3. smtpdef.h. This header file should never be touched. Smtpdef.h
  4. has a table describing every command the smtp serversupports.
  5. For instance, a few entries in this file contains :
  6. SmtpDef(NEWSMTPCOMMAND1)
  7. SmtpDef(NEWSMTPCOMMAND2)
  8. SmtpDef(NEWSMTPCOMMAND3)
  9. SmtpDef(NEWSMTPCOMMAND4)
  10. SmtpDef(NEWSMTPCOMMANDETC)
  11. Other source files include atmdef.h, *AFTER* defining the AtmDef macro to extract only
  12. the value needed. For instance, below we need an enumeration of all the counters (ATMCOUNTERS).
  13. Therefore, before including atmdef.h, we make a macro to extract the first element of
  14. the array :#define SmtpDef(a) a,. Notice the comma at the end of the #define. It is
  15. not a mistake. It needs to be there to separate each element.
  16. To define an array of SDef, we do the following :
  17. enum smtpstate =
  18. {
  19. #undef SmtpDef
  20. #define SmtpDef(a) {a},
  21. #include "smtpdef.h"
  22. LastCounter
  23. };
  24. Notice that we first have to undefine the previous instance of SmtpDef, then make
  25. a new defination of the macro, which extracts all the element. Again, notice the
  26. comma. It needs to be there to separate each element. Also, notice how the array
  27. is terminated.
  28. The beauty of doing it this way is because, to add or delete a command, only one file
  29. has to change. Not two or three.
  30. I hope all of this makes sense.
  31. -Rohan
  32. */
  33. SmtpDef(EHLO)
  34. SmtpDef(HELO)
  35. SmtpDef(RCPT)
  36. SmtpDef(MAIL)
  37. SmtpDef(AUTH)
  38. SmtpDef(DATA)
  39. SmtpDef(STARTTLS)
  40. SmtpDef(TLS)
  41. SmtpDef(QUIT)
  42. SmtpDef(RSET)
  43. SmtpDef(NOOP)
  44. SmtpDef(VRFY)
  45. SmtpDef(ETRN)
  46. SmtpDef(TURN)
  47. SmtpDef(BDAT)
  48. SmtpDef(HELP)
  49. SmtpDef(_EOD)